Skip to content Skip to sidebar Skip to footer

Update Location Every 5sec Android

Hi I want get user location for every 5sec and user can change that duration like 10sec, 15sec upto 30sec i have spinner to choose this option this is my request private static f

Solution 1:

The setInterval method is not exact. This is mentioned in the documentation.

Also, use the same interval for setFastestInterval and setInterval to prevent your app from receiving location updates faster than the the interval you specified in setInterval.

Just add REQUEST.setFastestInterval(intervel); to your startPeriodicUpdates method.

Post a Comment for "Update Location Every 5sec Android"