我想知道fix中使用的卫星数,但它一直返回0。

GpsStatus gps = mlocManager.getGpsStatus(null);
    Iterable<GpsSatellite> sats = gps.getSatellites();
    Iterator satI = sats.iterator();
    int count = 0;
    while(satI.hasNext()){
        GpsSatellite gpssatellite = (GpsSatellite) satI.next();
        if (gpssatellite.usedInFix()){
        count++;
        }
    }

我在用密码
@Override
    public void onLocationChanged(Location loc)

我知道stackoverflow上还有一个类似的问题,但我尝试了代码,它仍然返回0。我试过模拟器和NexusS。

最佳答案

我想这是个重复的问题
:d希望解决问题
Getting the number of satellites from Location object
编辑:至少相似

08-25 23:05