我从 GPS 或网络获取位置。问题是我已经在 htc hope hd 上对其进行了测试,并且效果很好,但是现在我开始在三星银河位置的其他设备上进行测试,始终为空。
这是我获取位置的代码
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
currentLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if( currentLocation == null){
currentLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
}
提前致谢