I have implemented GCM in my application and I am using GSMRegistrar as suggested. No. I get an error in logcat
7-02 23:35:15.830: E/ActivityThread(10442): Activity com.abc.xyz.mnp has leaked IntentReceiver com.google.android.gcm.GCMBroadcastReceiver@44f8fb68 that was originally registered here. Are you missing a call to unregisterReceiver()?
What can I understand from this and looking at the code for GSMRegistrar, I need to call GSMRegistrar.onDestroy(this), but I could not figure out where I should call it? An onDestroy()activity call mnpcauses it to stop retrying forGSM Registartion
GSMRegistrar
GSMRegistrar.onDestroy(this)
onDestroy()
mnp
GSM Registartion
You can use the application context, not the activity context. Thus, the delay mechanism is not limited to the activity life cycle.
onDestory() , GCM.
, , . , . , GCMBroadcastReceiver , .
: GCM, :
, №3 , GCM SERVICE_NOT_AVAILABLE. , .
you need to destroy the GCMRegistrar in the onDestroy method of the activit class
unregisterReceiver(receiver); GCMRegistrar.onDestroy(this);