If I have some time, I'll look into it more, but for now, have you
tried to reverse the order of these calls:

activity.unregisterReceiver(ir);
locationManager.removeUpdates(new Intent("test"));

On Apr 5, 3:20 am, Jakob Bjerre Jensen <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I have an IntentReceiver IR, which I register as follows:
>
> locationManager.requestUpdates(..., new Intent("test"));
> IntentFilter filter = new IntentFilter();
> filter.addAction("test");
> IR ir = new IR(...);
> activity.registerReceiver(ir, filter);
>
> This works excellent. However doing my unregistration as follows:
>
> activity.unregisterReceiver(ir);   // ir = same concreate class instance
> as above
> locationManager.removeUpdates(new Intent("test"));
>
> still seems to produce broadcasts, which results in an error with message
> "Error receiving broadcast null in IR".
>
> What is wrong with my unregistration code, and what is the correct way?
>
> Also, should'nt it be enough just to call
> locationManager.removeUpdates(new Intent("test"))? Basically this
> says: "Don't inform me of any kind of broadcast from that location
> manager anymore".
>
> Best regards,
> Jakob Bjerre Jensen
--~--~---------~--~----~------------~-------~--~----~
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