本文整理匯總了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