Quick Tip: Updating the location update frequency

12 May 2014 | Comments

When using Google Play's Location Services and you want to change the frequency of the updates, make sure to do these in order:

stopLocationUpdates();
// This method should implement mLocationClient.removeLocationUpdates()

// Set the new frequency in your location client
updateLocationClient(frequency);

startLocationUpdates();
// This method should implement mLocationClient.requestLocationUpdates()
// which means it should check for isConnected() as well!

If you do not remove the updates before updating the frequency, it looks like the old frequency update is still active BUT a new one is started.