草庐IT

GCMRegistrar

全部标签

android - GCMRegistrar.onDestroy(context) 崩溃,接收器未注册

我应该如何调用GCMRegistrar.onDestroy?目前我的主要Activity包括:protectedvoidonDestroy(){GCMRegistrar.onDestroy(this);super.onDestroy();}在进行注册或取消注册然后杀死主要Activity后,我得到了这个:08-1315:43:56.459:E/AndroidRuntime(2389):FATALEXCEPTION:main08-1315:43:56.459:E/AndroidRuntime(2389):java.lang.RuntimeException:Unabletodestroy

android - GCM : java. lang.noclassdeffounderror : com. google.android.gcm.GCMRegistrar

我正在尝试使用以下代码将设备注册到GCM:publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);GCMRegistrar.checkDevice(this);//thefollowingfunctioncanberemovedwhendeployingtheappGCMRegistrar.checkManifest(this);finalStringregId=GCMRegistrar.getRegist
12