我有时会获得0,0的经度和纬度

时间:2014-01-03 21:28:33

标签: android geolocation

大部分时间它输出我的实际坐标,但有时我得到0,0 有人可以解释一下原因吗?

LocationManager locationManager = (LocationManager) context
        .getSystemService(Context.LOCATION_SERVICE);
List<String> providers = locationManager.getProviders(true);

Location location = null;
for (int i = 0; i < providers.size(); i++) {
    if ((location = locationManager.getLastKnownLocation(providers
            .get(i))) != null) {
        break;
    }

}                           

0 个答案:

没有答案