Why do we have to use locationManager.requestLocationUpdates?
Answers
Answered by
0
LocationManager locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
String bestProvider =locationManager.getBestProvider(criteria,true);
Location location =
locationManager.getLastKnownLocation(bestProvider);
if (location != null) {
onLocationChanged(location);
}
locationManager.requestLocationUpdates(bestProvider, 20000, 0,this);
Similar questions