当前位置: 首页>>代码示例>>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;未经允许,请勿转载。