On Sun, Mar 22, 2009 at 5:28 AM, Yuriy Olkhovyy <[email protected]> wrote:
>
> Is there a way to check before sending a broadcast (from a remote
> service) whether there are registered broadcast listeners? What I'd
> like to do is to send broadcasts only if there are registered
> listeners, otherwise make a toast. Does it make any sense?

Will there be more than one broadcast receiver? If not, then an easy
way to do this would be to add another broadcast receiver with a low
priority, so that it receives the (ordered) broadcast last, and then
have that receiver pop up a toast. The other receiver should call
abortBroadcast() in that case to prevent the final receiver from
receiving the broadcast.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to