I\'m supposed to update the listener every 5 seconds. But it doesn\'t. What could be wrong with my code?
Thanks a lot for any help!
package com.example.a
By setting it to 5000 ms it doesn't necessarily mean that you will get the location every 5th second. The time is more or less a best case scenario.
minTime the minimum time interval for notifications, in milliseconds. This field is only used as a hint to conserve power, and actual time between location updates may be greater or lesser than this value. http://developer.android.com/reference/android/location/LocationManager.html
Are you sure you have your activity running? If you want to recieve the location when the activity is sleeping you need a wake lock and a service.
For example in a GPS app I created I put 0 ms to get it as soon as possible but when debugging and checking the logcat I sometimes get the location every minute or so, not every second.