0
私は現在の緯度&経度を取得するには、次のメソッドを使用します。どのように緯度の小数の後ろに13個の番号を取得すると経度
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();
が、私は唯一の小数の後ろに8つの数字を持ってしまった問題緯度とLNG (緯度:52.51491445、lng:13.39044515) 私が持っているのは、緯度と経度が小数点以下13桁です。
どうすればいいですか? ありがとう
latには小数点以下8桁しかありませんか?それとも、この値の文字列表現です... – Selvin
それは、文字列ではありません – hectichavana
http://ja.wikipedia.org/wiki/Floating_point ...あなたが見ているものは単なる文字列であり、多分Doubleです。 toString()は小数点以下8桁のように見えます – Selvin