Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refresh rate for GPS - what's acceptable?

Tags:

android

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 problem, but not sure if that's true.

Thanks

like image 308
Mark Avatar asked Dec 03 '25 05:12

Mark


1 Answers

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.

like image 161
capecrawler Avatar answered Dec 04 '25 21:12

capecrawler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!