我使用以下方法来获取当前的纬度和经度:
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (locationManager == null) {
Toast.makeText(LocationsListActivity.this,
"Location Manager Not Available", Toast.LENGTH_SHORT)
.show();
}
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location == null)
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
double lat = location.getLatitude();
double lng = location.getLongitude();
但问题是我得到的 lat 和 lng 小数点后只有 8 个数字(lat: 52.51491445, lng: 13.39044515) 我想要的是 lat 和 lng 我得到的小数点后有 13 个数字。
我怎样才能做到这一点?谢谢