GPS update rate - which is acceptable?

I'm trying to figure out the refresh rate used for my GPS location receiver to get around the error on HTC Hero where the GPS icon will not remove itself from the notification bar.

http://groups.google.com/group/android-developers/browse_thread/thread/e687b3bfa9146f31/7fa59b0108bbdf89?lnk=gst&q=gps#7fa59b0108bbdf89

Does anyone have any suggestions? For my application, I usually run with a refresh rate of 5 minutes. But when I close the application and unregister my listeners, the GPS icon still remains in the notification panel. Does anyone have an HTC Hero and can confirm this?

The link above shows that using an update rate of less than 35 seconds fixes the problem but is not sure if this is true.

thank

+3
source share
2 answers

Try removing updates to your location manager in the onDestroy method of your activity. tp delete gps icon.

Just like that ..

@Override
public void onDestroy() {
    super.onDestroy();
    locationManager.removeUpdates(this);
}

where locationManager is of type LocationManager.

+1
source

Have you tried setting your refresh rate below to test this theory, or don't you have a hero to test? If it supposedly fixes the problem, simply set the refresh rate to a lower setting before unregistering your listeners.

0
source

Source: https://habr.com/ru/post/1726198/


All Articles