How get the current latitud and longitud without use getLastKnownLocation method in Android?
- 阅读更多 关于 How get the current latitud and longitud without use getLastKnownLocation method in Android?
I am trying to get the current position of the phone, for this I use the GPSTracker tutorial , the problem is always use the method getLastKnownLocation and return older position. if (isNetworkEnabled) { locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); Log.d("Network", "Network"); if (locationManager != null) { location = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if (location != null) { latitude = location.getLatitude(); longitude = location.getLongitude(); } } } // if GPS