I have extended the Application class in my app. In that class, I have a BroadcastReceiver that waits for Connectivity changes. If complete connectivity is lost, I am displaying a specific activity. However, if the app is not "in focus" (not in the foreground), I don't want to display that activity.
However, the Application class does not have an onPause or onResume method. How can I display this activity ONLY if the app is running? Do I have to have a BroadcastReceiver in all my Acitivities (there's quite a few of them, and I can't create an extended Activity for all of them since they extend different Activity classes (Activity, ListActivity, FragmentActivity, etc). Is it possible to only have one BroadcastReceiver where action is taken if and only if one of the app's Activities is in the foreground?