Activity unregister / Leaked IntentReceiver issue
refer to
This is a Android activity life cycle issue. I am seeing it in a main activity and then testing on device with the back button that goes back to a splash screen.
In the onPause() method.
Unregister the Broadcast Receiver that you created in the onCreate()
In the onRestart() re-register a brand new Broadcast Receiver.
In the activity class you need to keep a record of the Broadcast Receiver as instance data member.
SECOND
I think this also a feature enhancement issue with Android.
Sometimes developer need a broadcast receiver to outlive the activity. For example to understand when certain screen states are available or not. Think about a conversation context of work flow model, which has many states.
THIRD
You can register and unregister broadcast receivers with an activity, but a simple call like isRegistered(BroadcastReceiver) in the Activity class might be very useful.
If you need receivers to live beyond the activity, then I do not the answer, except to silence the warning, by adding unregister(X) in the onDestroy() call. YMMV ;-)