i'm working with android's location manager, and i notice that when I try to use requestLocationUpdates right after I turn on GPS, it gives a null location. how do i ensure I always get a valid location when i call requestlocationupdates?
my code is:
//update the location
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
//get the location
location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);