當前位置: 首頁>>代碼示例>>Java>>正文


Java GCMRegistrar.onDestroy方法代碼示例

本文整理匯總了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);
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:19,代碼來源:BaseActivity.java

示例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();
}
 
開發者ID:halimbimantara,項目名稱:Arduscam,代碼行數:17,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:The-WebOps-Club,項目名稱:saarang-iosched,代碼行數:19,代碼來源:BaseActivity.java

示例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);
}
 
開發者ID:appez,項目名稱:appez-android,代碼行數:17,代碼來源:PushNotificationUtility.java

示例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();
}
 
開發者ID:abhijith-gururaj,項目名稱:push-notifications-WebView,代碼行數:14,代碼來源:WebViewActivity.java

示例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();
}
 
開發者ID:10xEngineer,項目名稱:My-Wallet-Android,代碼行數:12,代碼來源:WalletActivity.java

示例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());
	}
}
 
開發者ID:thoinv,項目名稱:kaorisan,代碼行數:11,代碼來源:TaskActivity.java

示例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();
}
 
開發者ID:army-of-dumbledore,項目名稱:pennappsF13,代碼行數:10,代碼來源:DemoActivity.java

示例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( );
	}
}
 
開發者ID:hyperfiction,項目名稱:HypNotif,代碼行數:9,代碼來源:HypNotif.java

示例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();
}
 
開發者ID:bhavyanshu,項目名稱:ITM_Android_App,代碼行數:14,代碼來源:MainScreenActivity.java

示例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);
    }
}
 
開發者ID:amardeshbd,項目名稱:google-iosched,代碼行數:15,代碼來源:HomeActivity.java

示例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);
    }
}
 
開發者ID:TheDeltaProgram,項目名稱:iosched2013,代碼行數:15,代碼來源:HomeActivity.java

示例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());
}
 
開發者ID:protyposis,項目名稱:Studentenportal,代碼行數:6,代碼來源:GCMUtils.java

示例14: onDestroy

import com.google.android.gcm.GCMRegistrar; //導入方法依賴的package包/類
public void onDestroy() {
    GCMRegistrar.onDestroy(mContext);
    cleanUp();
    sInstance = null;
}
 
開發者ID:AppGyver,項目名稱:PushNotifications,代碼行數:6,代碼來源:NotificationService.java

示例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


注:本文中的com.google.android.gcm.GCMRegistrar.onDestroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。