0
У меня есть функция, которая перенастраивает мое текущее местоположение.Android- Текущее местоположение
public LatLng getCurrentLocation() {
LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = service.getBestProvider(criteria, false);
Location location = service.getLastKnownLocation(provider);
LatLng userLocation = new LatLng(location.getLatitude(),location.getLongitude());
//Log.e("Location",userLocation.latitude+ " x "+ userLocation.longitude);
return userLocation;
}
Проблема в том, что когда я переехал в другое место (50 км), я все еще возвращаю предыдущее местоположение. Любые идеи, почему это так?
пожалуйста, проверьте этот answear: [http://stackoverflow.com/questions/17591147/how-to- получить тока-место-в-андроида] (http://stackoverflow.com/questions/17591147/how-to-get-current-location-in-android) –