Refresh rate for GPS - what's acceptable?
I'm trying to figure out a refresh rate to use for my GPS location listener to get around a bug on the HTC Hero where the GPS icon won't remove itself off the notification bar.
http://groups.google.com/group/android-developers/browse_thread/thread/e687b3bfa9146f31/7fa59b0108bbdf89?lnk=gst&q=gps#7fa59b0108bbdf89
Does anyone here have any suggestions? For my app, I'd normally run with a refresh rate of 5 minutes. But when I close the app, and de-register my listeners, the GPS icon sometimes still stays on the notification bar. Does anyone have an HTC Hero and can confirm this?
The link above suggests that using a refresh rate of under 35 seconds fixes the probl开发者_JAVA百科em, but not sure if that's true.
Thanks
Try to removeupdates of your location manager in the onDestroy method of your activity tp remove the gps icon.
Just like this..
@Override
public void onDestroy() {
super.onDestroy();
locationManager.removeUpdates(this);
}
where locationManager is of type LocationManager.
Have you tried setting your refresh rate lower just to test this theory out, or do you not have a Hero yourself to test on? If it does allegedly fix the problem then just set the refresh rate to a lower setting before you de-register your listeners.
精彩评论