GpsStatusListener: no satellites used in fix although status is GpsStatus.GPS_EVENT_FIRST_FIX

南笙酒味 提交于 2019-12-02 04:30:30

问题


I added a gps status listener to my location manager in order see when I get the first fix.

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());
            }
        }
    }
}

Log:

gpsx.fixed.
gpsx.GpsStatus.Sat.fixed: false
gpsx.GpsStatus.Sat.fixed: false
gpsx.GpsStatus.Sat.fixed: false

回答1:


seems to me like a bug or at least some 'unlogic', reported it at

http://code.google.com/p/android/issues/detail?id=10134



来源:https://stackoverflow.com/questions/3287389/gpsstatuslistener-no-satellites-used-in-fix-although-status-is-gpsstatus-gps-ev

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!