本文整理汇总了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);
}