I was wondering the same thing. In my case I have a BroadcastReceiver implementation that calls Context#unregisterReceiver(BroadcastReceiver) passing itself as the arg after handling the Intent that it receives. There is a small chance that the receiver's onReceive(Context, Intent) method is called more than once, since it is registered with multiple IntentFilters, creating the potential for an IllegalArgumentException being thrown from Context#unregisterReceiver(BroadcastReceiver).
In my case I can store a private synchronized member to check before calling Context#unregisterReceiver(BroadcastReceiver), but it would be much cleaner if the API provided a check method. On Mar 11, 9:23 am, Sam <[email protected]> wrote: > Hi, > > I'm using more than 1 instance of MapActivity in an application that > look different from each other. I'm running into an issue sometimes > when leaving a MapActivity doesn'tunregisterit's BroadcastReceiver > and going Back to resume the MapActivity page it tries to re-register > thereceiveragain, thus receiving an Exception thatReceiveralready > registered. > > Anyone know of a way to tell if a Broadcastreceiver is registered and > is listening? > > Sam -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

