本文整理汇总了Java中com.google.android.gcm.GCMRegistrar.onDestroy方法的典型用法代码示例。如果您正苦于以下问题:Java GCMRegistrar.onDestroy方法的具体用法?Java GCMRegistrar.onDestroy怎么用?Java GCMRegistrar.onDestroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gcm.GCMRegistrar
的用法示例。
在下文中一共展示了GCMRegistrar.onDestroy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
super.onDestroy();
if (mGCMRegisterTask != null) {
LOGD(TAG, "Cancelling GCM registration task.");
mGCMRegisterTask.cancel(true);
}
try {
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
LOGW(TAG, "C2DM unregistration error", e);
}
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
sp.unregisterOnSharedPreferenceChangeListener(this);
}
示例2: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
unregisterReceiver(SmsIntentReceiver);
if (mRegisterTask != null) {
mRegisterTask.cancel(true);
}
try {
unregisterReceiver(mHandleMessageReceiver);
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
Log.e("UnRegister Receiver Error", "> " + e.getMessage());
}
super.onDestroy();
}
示例3: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
super.onDestroy();
if (mGCMRegisterTask != null) {
LogUtils.LOGD(TAG, "Cancelling GCM registration task.");
mGCMRegisterTask.cancel(true);
}
try {
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
LogUtils.LOGW(TAG, "C2DM unregistration error", e);
}
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
sp.unregisterOnSharedPreferenceChangeListener(this);
}
示例4: unregister
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
/**
* Unregister this account/device pair within the server.
*/
public void unregister(NotifierEvent notifierEvent) {
this.currentEvent = CURRENT_EVENT_PUSH_UNREGISTER;
this.currentNotifierEvent = notifierEvent;
initUnregistrationParams(notifierEvent);
context.registerReceiver(mHandleMessageReceiver, new IntentFilter(DISPLAY_MESSAGE_ACTION));
if (mHandleMessageReceiver != null) {
context.unregisterReceiver(mHandleMessageReceiver);
}
GCMRegistrar.unregister(context);
GCMRegistrar.onDestroy(context);
}
示例5: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
if (mRegisterTask != null) {
mRegisterTask.cancel(true);
}
try {
unregisterReceiver(mHandleMessageReceiver);
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
Log.e("UnRegisterReceiverError", "> " + e.getMessage());
}
super.onDestroy();
}
示例6: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
instance = null;
if (mRegisterTask != null) {
mRegisterTask.cancel(true);
}
unregisterReceiver(mHandleMessageReceiver);
GCMRegistrar.onDestroy(this);
super.onDestroy();
}
示例7: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
super.onDestroy();
try {
unregisterReceiver(mHandleMessageReceiver);
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
Log.e("UnRegister Receiver Error", "> " + e.getMessage());
}
}
示例8: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
if (mRegisterTask != null) {
mRegisterTask.cancel(true);
}
unregisterReceiver(mHandleMessageReceiver);
GCMRegistrar.onDestroy(this);
super.onDestroy();
}
示例9: dispose
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
public static void dispose( ) {
Utils.dispose( );
try{
GCMRegistrar.onDestroy( GameActivity.getInstance( ) );
} catch ( Exception e ) {
e.printStackTrace( );
}
}
示例10: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
if (mRegisterTask != null) {
mRegisterTask.cancel(true);
}
try {
unregisterReceiver(mHandleMessageReceiver);
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
Log.e("UnRegister Receiver Error", "> " + e.getMessage());
}
super.onDestroy();
}
示例11: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
super.onDestroy();
if (mGCMRegisterTask != null) {
mGCMRegisterTask.cancel(true);
}
try {
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
LOGW(TAG, "GCM unregistration error", e);
}
}
示例12: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
super.onDestroy();
if (mGCMRegisterTask != null) {
mGCMRegisterTask.cancel(true);
}
try {
GCMRegistrar.onDestroy(this);
} catch (Exception e) {
LOGW(TAG, "C2DM unregistration error", e);
}
}
示例13: OnMainActivityDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
public static void OnMainActivityDestroy(Context context) {
// application context must be used, else an exception is thrown
// http://stackoverflow.com/a/11937272
GCMRegistrar.onDestroy(context.getApplicationContext());
}
示例14: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
public void onDestroy() {
GCMRegistrar.onDestroy(mContext);
cleanUp();
sInstance = null;
}
示例15: onDestroy
import com.google.android.gcm.GCMRegistrar; //导入方法依赖的package包/类
@Override
public void onDestroy() {
super.onDestroy();
doUnbindService();
GCMRegistrar.onDestroy(activity.getApplicationContext());
}
开发者ID:GoogleCloudPlatform,项目名称:solutions-griddler-sample-android-client,代码行数:7,代码来源:GoogleServicesFragment.java