01-16 16:52:42.211: E/ActivityThread(2529): Activity com.Civilcourage.CivilcurageSplash has leaked IntentReceiver com.google.android.gcm.GCMBroadcastReceiver@405282e0 that was originally registered here.
Are you missing a call to unregisterReceiver()?
What is the cause of the above error? How can it be avoided?
Don't rely on onStop(), because:
Note that this method may never be called, in low memory situations where the system does not have enough memory to keep your activity's process running after its onPause() method is called
More on Activity life cycle here.
Unregister your receiver in onPause():
@Override
protected void onPause() {
super.onPause();
unregisterReceiver(yourReceiver);
}
You need to unregister your receivers on stop of your activity:
@Override
protected void onStop()
{
unregisterReceiver(yourReceiver);
super.onStop();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With