Reputation: 323
Is there a way to restrict the call to onLocationChanged if user has not moved 10 meters or more.
I am using google map with map fragment.
Upvotes: 0
Views: 471
Reputation: 6067
Use Google fuesed location api for location updates.
And for distance use LocationRequest.setSmallestDisplacement() method. For that - https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html#public-methods
Upvotes: 0
Reputation: 1202
Initialize location manager with parameter minimum distance to 10 and minimum time to 0 .
http://blog.doityourselfandroid.com/2010/12/25/understanding-locationlistener-android/
Upvotes: 1