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


Java JPushInterface.stopPush方法代碼示例

本文整理匯總了Java中cn.jpush.android.api.JPushInterface.stopPush方法的典型用法代碼示例。如果您正苦於以下問題:Java JPushInterface.stopPush方法的具體用法?Java JPushInterface.stopPush怎麽用?Java JPushInterface.stopPush使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cn.jpush.android.api.JPushInterface的用法示例。


在下文中一共展示了JPushInterface.stopPush方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
	switch (v.getId()) {
	case R.id.init:
		init();
		break;
	case R.id.setting:
		Intent intent = new Intent(MainActivity.this, PushSetActivity.class);
		startActivity(intent);
		break;
	case R.id.stopPush:
		JPushInterface.stopPush(getApplicationContext());
		break;
	case R.id.resumePush:
		JPushInterface.resumePush(getApplicationContext());
		break;
	case R.id.getRegistrationId:
		String rid = JPushInterface.getRegistrationID(getApplicationContext());
		if (!rid.isEmpty()) {
			mRegId.setText("RegId:" + rid);
		} else {
			Toast.makeText(this, "Get registration fail, JPush init failed!", Toast.LENGTH_SHORT).show();
		}
		break;
	}
}
 
開發者ID:LuoLuo0101,項目名稱:JPush,代碼行數:27,代碼來源:MainActivity.java

示例2: unregister

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
public static void unregister(Context context) {
    if (context == null)
        return;
    if (RomUtil.rom() == Target.EMUI) {
        EMHuaweiPushReceiver.clearPushInterface();
        PushManager.deregisterToken(context, getToken(context).getToken());
        return;

    }
    if (RomUtil.rom() == Target.MIUI) {
        MiuiReceiver.clearPushInterface();
        MiPushClient.unregisterPush(context);
        return;
    }
    if (RomUtil.rom() == Target.FLYME) {
        FlymeReceiver.clearPushInterface();
        com.meizu.cloud.pushsdk.PushManager.unRegister(context, Const.getFlyme_app_id(), Const.getFlyme_app_key());
        return;
    }

    if (RomUtil.rom() == Target.JPUSH) {
        JPushReceiver.clearPushInterface();
        JPushInterface.stopPush(context);
        return;
    }
}
 
開發者ID:jiang111,項目名稱:AndroidPush,代碼行數:27,代碼來源:Push.java

示例3: onClick

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
	int i = v.getId();
	if (i == R.id.init) {
		init();

	} else if (i == R.id.setting) {
		Intent intent = new Intent(MainActivity.this, PushSetActivity.class);
		startActivity(intent);

	} else if (i == R.id.stopPush) {
		JPushInterface.stopPush(getApplicationContext());

	} else if (i == R.id.resumePush) {
		JPushInterface.resumePush(getApplicationContext());

	} else if (i == R.id.getRegistrationId) {
		String rid = JPushInterface.getRegistrationID(getApplicationContext());
		if (!TextUtils.isEmpty(rid)) {
			mRegId.setText("RegId:" + rid);
		} else {
			Toast.makeText(this, "Get registration fail, JPush init failed!", Toast.LENGTH_SHORT).show();
		}

	}
}
 
開發者ID:xujiaji,項目名稱:HaiNaBaiChuan,代碼行數:27,代碼來源:MainActivity.java

示例4: unregister

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
public static void unregister(Context context) {
    if (context == null)
        return;
    if (RomUtil.rom() == PhoneTarget.EMUI) {
        HWReceiver.clearPushListener();
        com.huawei.android.pushagent.api.PushManager.deregisterToken(context, getToken(context).getToken());
        return;

    }
    if (RomUtil.rom() == PhoneTarget.MIUI) {
        MiMessageReceiver.clearPushListener();
        MiPushClient.unregisterPush(context);
        return;
    }

    if (RomUtil.rom() == PhoneTarget.JPUSH) {
        JPushReceiver.clearPushListener();
        JPushInterface.stopPush(context);
        return;
    }
}
 
開發者ID:beanu,項目名稱:smart-farmer-android,代碼行數:22,代碼來源:PushManager.java

示例5: switchJPushMode

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
 * 更改推送的狀態
 */
private void switchJPushMode() {
    // 獲得之前的狀態
    boolean isStoped = JPushInterface.isPushStopped(getApplicationContext());
    // 取反並設置
    setImageButtonState(mSettingJpush, isStoped);
    // 更改推送狀態
    if (isStoped) {
        JPushInterface.resumePush(getApplicationContext());
    } else {
        JPushInterface.stopPush(getApplicationContext());
    }

}
 
開發者ID:Jay-Ping,項目名稱:newIPlay,代碼行數:17,代碼來源:SettingActivity.java

示例6: onClick

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.resumePush:
            JPushInterface.resumePush(v.getContext());
            break;
        case R.id.stopPush:
            JPushInterface.stopPush(v.getContext());
            break;
        case R.id.isStopPush:
            boolean isStop = JPushInterface.isPushStopped(v.getContext());
            Toast.makeText(this, isStop ? "停止了推送" : "開始了推送", Toast.LENGTH_SHORT).show();
            break;
    }
}
 
開發者ID:LuoLuo0101,項目名稱:JPush,代碼行數:16,代碼來源:MainActivity.java

示例7: pause

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
 * 停止推送
 */
public static void pause(Context context) {
    if (context == null)
        return;
    if (RomUtil.rom() == Target.EMUI) {
        PushManager.enableReceiveNormalMsg(context, false);
        PushManager.enableReceiveNotifyMsg(context, false);
        if (EMHuaweiPushReceiver.getPushInterface() != null) {
            EMHuaweiPushReceiver.getPushInterface().onPaused(context);
        }
        return;

    }
    if (RomUtil.rom() == Target.MIUI) {
        MiPushClient.pausePush(context, null);
        if (MiuiReceiver.getPushInterface() != null) {
            MiuiReceiver.getPushInterface().onPaused(context);
        }
        return;
    }
    if (RomUtil.rom() == Target.FLYME) {
        com.meizu.cloud.pushsdk.PushManager.unRegister(context, Const.getFlyme_app_id(), Const.getFlyme_app_key());
        if (FlymeReceiver.getPushInterface() != null) {
            FlymeReceiver.getPushInterface().onPaused(context);
        }
        return;
    }

    if (RomUtil.rom() == Target.JPUSH) {
        if (!JPushInterface.isPushStopped(context)) {
            JPushInterface.stopPush(context);
            if (JPushReceiver.getPushInterface() != null) {
                JPushReceiver.getPushInterface().onPaused(context);
            }
        }
        return;
    }

}
 
開發者ID:jiang111,項目名稱:AndroidPush,代碼行數:42,代碼來源:Push.java

示例8: pause

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
 * 停止推送
 */
public static void pause(Context context) {
    if (context == null)
        return;
    if (RomUtil.rom() == PhoneTarget.EMUI) {
        com.huawei.android.pushagent.api.PushManager.enableReceiveNormalMsg(context, false);
        com.huawei.android.pushagent.api.PushManager.enableReceiveNotifyMsg(context, false);
        if (HWReceiver.getPushListener() != null) {
            HWReceiver.getPushListener().onPaused(context);
        }
        return;

    }
    if (RomUtil.rom() == PhoneTarget.MIUI) {
        MiPushClient.pausePush(context, null);
        if (MiMessageReceiver.getPushListener() != null) {
            MiMessageReceiver.getPushListener().onPaused(context);
        }
        return;
    }

    if (RomUtil.rom() == PhoneTarget.JPUSH) {
        if (!JPushInterface.isPushStopped(context)) {
            JPushInterface.stopPush(context);
            if (JPushReceiver.getPushListener() != null) {
                JPushReceiver.getPushListener().onPaused(context);
            }
        }
    }

}
 
開發者ID:beanu,項目名稱:smart-farmer-android,代碼行數:34,代碼來源:PushManager.java

示例9: exitClient

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**TODO 退出APP */
public void exitClient()
{
	JPushInterface.stopPush(this);
	JPushInterface.onKillProcess(this);
	if (null != mBMapManager)
	{
		mBMapManager.stop();
		mBMapManager.destroy();
	}
	stopService(mNetworkIntent);
	if (mActivities.size() > 0)
	{
		for (int i = 0; i < mActivities.size(); i++)
		{
			Activity activity = mActivities.get(i);
			if (null != activity)
			{
				activity.finish();
			}
		}
	}
	ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
	activityManager.killBackgroundProcesses(getPackageName());
	android.os.Process.killProcess(android.os.Process.myPid());
	System.exit(10);

}
 
開發者ID:haikuowuya,項目名稱:like_googleplus_layout,代碼行數:29,代碼來源:GoogleApplication.java

示例10: stopPush

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
public static void stopPush(JSONArray data, CallbackContext callbackContext) {
  JPushInterface.stopPush(cordovaCxt);
}
 
開發者ID:pengkobe,項目名稱:nxtpush-cordova-plugin,代碼行數:4,代碼來源:JPushUtil.java

示例11: exit

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
public void exit() {
	if (mLoginManager.getUserId()!=-1) {
		mLoginManager.delete();
	}
	JPushInterface.stopPush(getApplicationContext());
}
 
開發者ID:AskViky,項目名稱:CommunityService,代碼行數:7,代碼來源:MorePageActivity.java

示例12: msgStop

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Click( R.id.msg_stop )
void msgStop()
{
    JPushInterface.stopPush( getApplicationContext() );
}
 
開發者ID:amar19860330,項目名稱:amar-android-demo,代碼行數:6,代碼來源:ServiceActivity.java

示例13: stop

import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
* 
*/
  public void stop() {
      JPushInterface.stopPush(mContext);
  }
 
開發者ID:RincLiu,項目名稱:Roid-Library,代碼行數:7,代碼來源:RLPushHelper.java


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