I am developing location tacker application in android so in service on start method I have register requestLocationupdate method with it's parameter locationManager.requestLocationUpdates(bestProvider, getTimePreferance(), getDistancePreferance(), listener);开发者_StackOverflow社区 Service starts when application reboot or installed So it works fine.. But there is another activity name is settings. Where user can set 2 parameter minimum distace interval and minimum time interval notification, and whatever value user will enter I will store in preferance. I refer same preferance while register requestLocationUpdates method. So my question is does it automatically update the method parameter while user change preferance value?? or is that any another method to reset requestLocationUpdate() method.. help me to come out. Thanks in advance
I can't find any documentation about it, but I did a similar service like you, and during testing I noticed that the LocationListener has to be deregistered and later the requestLocationUpdate method has to be called again with the new parameters. I don't know if there is a better solution, but in my case this worked.
精彩评论