本文整理匯總了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;
}
}
示例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;
}
}
示例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();
}
}
}
示例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;
}
}
示例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());
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
}
}
示例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);
}
示例10: stopPush
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
public static void stopPush(JSONArray data, CallbackContext callbackContext) {
JPushInterface.stopPush(cordovaCxt);
}
示例11: exit
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
public void exit() {
if (mLoginManager.getUserId()!=-1) {
mLoginManager.delete();
}
JPushInterface.stopPush(getApplicationContext());
}
示例12: msgStop
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Click( R.id.msg_stop )
void msgStop()
{
JPushInterface.stopPush( getApplicationContext() );
}
示例13: stop
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
*
*/
public void stop() {
JPushInterface.stopPush(mContext);
}