Notification跳转后回退不会到桌面

来源:互联网 发布:每日工作计划软件 编辑:程序博客网 时间:2024/04/30 11:10
    Intent[] makeIntentStack(Context context) {        Intent[] intents = new Intent[2];        intents[0] = Intent.makeRestartActivityTask(new ComponentName(context, aActivity.class));        intents[1] = new Intent(context, bActivity.class);        return intents;    }
        PendingIntent pendingIntent = PendingIntent.getActivities(MyApplication.getContext(),0,makeIntentStack(MyApplication.getContext(),in),PendingIntent.FLAG_CANCEL_CURRENT);
这样,点击notification 会前往bActivity,回退会回退到aActivity。

0 0
原创粉丝点击