注册

后台通知栏跳转不了

本帖最后由 breeze 于 2015-5-20 18:46 编辑


@Override
public Intent getLaunchIntent(EMMessage message) {
//设置点击通知栏跳转事件
Intent intent = new Intent(appContext, EaseChattingActivity.class);
intent.putExtra(EaseChatService.DST_USERNAME, message.getFrom());
return intent;

}程序运行后台时,我设置了通知栏跳转的activity,但是点击通知栏后没有跳转,什么原因
已邀请:

breeze - 如:80后IT男..

> forum.php?mod=redirect&goto=findpost&pid=3171&ptid=1422
百度一堆资料


已解决了,AndroidMainfest.xml中对应的exported=true就可以了
public static PendingIntent getActivity (Context context, int requestCode, Intent intent, int flags)
Added in API level 1

Retrieve a PendingIntent that will start a new activity, like calling Context.startActivity(Intent). Note that the activity will be started outside of the context of an existing activity, so you must use the Intent.FLAG_ACTIVITY_NEW_TASK launch flag in the Intent.
你的flag要设置成Intent.FLAG_ACTIVITY_NEW_TASK
> forum.php?mod=redirect&goto=findpost&pid=3166&ptid=1422
public static PendingIntent getActivity (Context context, int requestCode, Intent intent, int flags ...


百度一堆资料
> forum.php?mod=redirect&goto=findpost&pid=3166&ptid=1422
public static PendingIntent getActivity (Context context, int requestCode, Intent intent, int flags ...


百度一堆资料

要回复问题请先登录注册