2011-08-04 6 views
3

나는 수정에 사용되는 위성의 수를 가져올하지만 나는이 있음을 알고안드로이드 수는

@Override 
    public void onLocationChanged(Location loc) 

에 내가 코드를 사용하고 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++; 
     } 
    } 

를 반환 유지 stackoverflow에 대한 질문이 하나 더 있지만 여전히 0을 반환하는 코드를 시도했습니다. 에뮬레이터와 Nexus S를 사용해 보았습니다.

답변