From 1eb4354b4601108e5d8aa3bf9d0aad91c46bfba9 Mon Sep 17 00:00:00 2001 From: zhangqinghe Date: Thu, 19 Mar 2015 16:18:35 +0800 Subject: [PATCH] add new code in notification --- Plugins/Android/src/MyReceiver.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Plugins/Android/src/MyReceiver.java b/Plugins/Android/src/MyReceiver.java index e896f68..9cfe6d3 100644 --- a/Plugins/Android/src/MyReceiver.java +++ b/Plugins/Android/src/MyReceiver.java @@ -50,6 +50,11 @@ public void onReceive(Context context, Intent intent) { Log.d(TAG, "[MyReceiver] 用户点击打开了通知"); JPushInterface.reportNotificationOpened(context, bundle.getString(JPushInterface.EXTRA_MSG_ID)); + Intent launch = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); + launch.addCategory(Intent.CATEGORY_LAUNCHER); + launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_SINGLE_TOP); + context.startActivity(launch); + //把数据打包,交给用户自己处理 if(!JPushBridge.ISQUIT) { Log.d(TAG, "coming in---------no quit");