我的应用程序被传递信息的意图调用(状态栏中的待定意图)但是当我点击主页按钮并通过按住主页按钮重新打开我的应用程序时,它再次调用该意图并且仍然存在相同的额外内容......
有什么办法可以清除意图?或者检查之前是否使用过?
Intent intent = new Intent(context, MainActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.putExtra("reportID", reportID);
    intent.putExtra("message", message);
    intent.putExtra("toast_show", true);
    intent.putExtra("detail_open", true);
    intent.putExtra("SplashActivity", true);
    PendingIntent pendingIntent = PendingIntent
            .getActivity(context.getApplicationContext(), 0, intent,
                    PendingIntent.FLAG_UPDATE_CURRENT
                            | PendingIntent.FLAG_ONE_SHOT);
    // Intent.FLAG_ACTIVITY_NEW_TASK
    /* get the system service that manage notification NotificationManager */
    NotificationManager notificationManager = (NotificationManager) context
            .getApplicationContext().getSystemService(
                    Context.NOTIFICATION_SERVICE);
    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(
            context.getApplicationContext())
            .setWhen(when)
            .setContentText(message)
            .setContentTitle(title)
            .setSmallIcon(smalIcon)
            .setAutoCancel(true)
            .setTicker(message)
            .setLargeIcon(largeIcon)
            .setDefaults(
                    Notification.DEFAULT_LIGHTS
                            | Notification.DEFAULT_VIBRATE
                            | Notification.DEFAULT_SOUND)
            .setContentIntent(pendingIntent);
    /* Create notification with builder */
    Notification notification = notificationBuilder.build();
    notificationManager.notify(0, notification);
当我收到通知时,问题就开始了。如果我从通知启动应用程序,它会启动正确的屏幕,我可以使用应用程序 => 好的。但是当我退出应用程序(使用主页或返回按钮)时,它不再出现在“最近的应用程序”列表中。更准确地说:有谁知道如何在启动通知后将应用程序保留在“最近的应用程序”列表中?