本文介绍了GpsStatusListener:尽管状态为 GpsStatus.GPS_EVENT_FIRST_FIX,但没有使用卫星进行修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我向我的位置管理器添加了一个 gps 状态侦听器,以便查看我何时获得第一个修复.
I added a gps status listener to my location manager in order see when I get the first fix.
当我收到 GPS_EVENT_FIRST_FIX 时,我会遍历所有卫星,但为什么没有一个用于修复?(usedInFix()
).
When I receive the GPS_EVENT_FIRST_FIX I then loop through all the satellites, but why is none of them used in the fix? (usedInFix()
).
我的日志对所有卫星都显示为假"?
My log says 'false' for all satellites?
final class GpsStatusListener implements GpsStatus.Listener {
public void onGpsStatusChanged(int i) {
if (i==GpsStatus.GPS_EVENT_FIRST_FIX) {
Log.d(APP, "gpsx.fixed.");
for (GpsSatellite sat:locationManager.getGpsStatus(null).getSatellites()) {
Log.d(APP, "gpsx.GpsStatus.Sat.fixed: " + sat.usedInFix());
}
}
}
}
日志:
gpsx.fixed.
gpsx.GpsStatus.Sat.fixed: false
gpsx.GpsStatus.Sat.fixed: false
gpsx.GpsStatus.Sat.fixed: false
推荐答案
在我看来像是一个错误,或者至少是一些不合逻辑",报告于
seems to me like a bug or at least some 'unlogic', reported it at
http://code.google.com/p/android/issues/detail?id=10134
这篇关于GpsStatusListener:尽管状态为 GpsStatus.GPS_EVENT_FIRST_FIX,但没有使用卫星进行修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!