> I would love to hear any work arounds for this I have been struggling
> with this for an age without realising its a bug!

With M5, I haven't run into this bug, but it may be that my usage of
location updates differs from the ones that are getting the bug.

I get the updates in an activity (vs. a service). I turn off updates in
onPause() and resume them in onResume(), since in my case I don't need the
updates if the activity isn't visible.

I turn off updates using:

myLocationManager.removeUpdates(myIntent);
unregisterReceiver(intentReceiver);

where intentReceiver and myIntent are instance variables in the activity
itself.

It may be that I'm "immune" to the bug in that the time gap between
onPause() and my activity being destroyed is too long to trigger the bug.
Near as I can tell from the referenced thread, the issue is that the
IntentReceiver is no longer around when the last update or two get sent;
in my case, my IntentReceiver probably is around long enough to get those
last updates.

So, as far as a workaround, try to keep your IntentReceiver around after
disabling updates. This may mean disabling updates earlier than you are
doing now, or it may be your IntentReceiver is somehow going out of scope
and is getting garbage collected earlier than is necessary.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
The Busy Coder's Guide to Android Development -- coming in June 2008!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to