我無法從GPS獲取精確的緯度,經度。我需要獲取Android地圖上谷歌地圖上的小藍色指針(我的當前位置)的位置......但我是獲取手動放置紅色標記的位置。 這裏是ScreenSnap .. 這裏是獲取紅色標記位置的代碼。無法從GPS獲取準確的位置
if (isNetworkEnabled) {
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
if(isGPSEnabled) {
if(location == null) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
if(locationManager != null) {
location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if(location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
}
你是不是從GPS設備請求您所在的位置爲你的主題建議。使用GPS設備來確定你的位置。 – greenapps
sory我粘貼只有一塊代碼...我編輯帖子與第二個功能,它需要從GPS的位置... –
我只需要知道...有任何方式(功能)來獲取位置的建在地圖上標註的「藍點」?因爲它總是被標記在完美的位置點。 –