Search code examples
androidlocationmanager

If I do not define any time and distance in requestLocationUpdates(), what will happen?


If I cant pass minimum time and distance in this method, what will happen? When will this method be called?

locationManager.requestLocationUpdates(provider,0, 0,locationListener);

Solution

  • by setting minTime and minDistance to 0 you will get a dead phone.

    by the docs:

    To obtain notifications as frequently as possible, set both parameters to 0.

    you will just get very very rapid responses and also the battery drain on a device will be horrendous.