I have a BroadcastReceiver(#1) that runs all the time to catch an event. When the event occurs, it may need to make UI changes on a particular activity (if that activity is active). To do this, I have BroadcastReceiver#1 create a new intent that is caught by a second BroadcastReceiver(#2) that lives on the activity, and is is registered/unregistered only when the Activity is not paused...as discussed here: Inform Activity from a BroadcastReceiver ONLY if it is in the foreground
All that is working...however, now I want BroadcastReceiver#1 to post a status notification when the activity is not in focus OR when it is in focus but chooses not to handle the event. Thus, the Activity (if active) needs some way to communicate back to BroadcastReceiver#1.
I thought I would have BroadcastReceiver#1 spawn a thread that will post the event with a notification after X seconds have elapsed...where this thread will have a THIRD broadcastreceiver#3, and if the recieving activity chooses to handle the event, it can send a "dont bother posting that notification" intent which will be caught by BroadcastReceiver#3 in order to abort the notification. However, this does not work, because Android does not allow one BroadcastReceiver to register another BroadcastReceiver.