大部分时间它输出我的实际坐标,但有时我得到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;
}
}