Android 通知包含来自上一个通知的数据

Android 通知包含来自上一个通知的数据,android,notifications,android-notifications,Android,Notifications,Android Notifications,我正在设置一个带有一些数据的通知,以打开我的一项活动。如果通知还没有被确认,我会用它覆盖,因为我用相同的ID调用通知 我看到Notification值发生了变化,但是,我注意到我在putExtra调用中输入到ReceiveMessage键的额外值实际上包含过时的信息。 NotificationManager.notify应该使用该ID重写现有通知,那么为什么我要处理通知意图中的过时信息呢 Intent notificationIntent = new Intent(context, MyActi

我正在设置一个带有一些数据的通知,以打开我的一项活动。如果通知还没有被确认,我会用它覆盖,因为我用相同的ID调用通知

我看到Notification值发生了变化,但是,我注意到我在putExtra调用中输入到ReceiveMessage键的额外值实际上包含过时的信息。 NotificationManager.notify应该使用该ID重写现有通知,那么为什么我要处理通知意图中的过时信息呢

Intent notificationIntent = new Intent(context, MyActivity.class);
notificationIntent.setAction(MyActivity.CustomInternalAction);
notificationIntent.putExtra(MyActivity.ReceiveMessage, rawMessageText);

notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
Notification notification = new Notification.Builder(context)
//......
mNotificationManager.notify(myId, notification);   

在调用
getActivity()

的过程中使用
pendingent.FLAG\u UPDATE\u CURRENT
确定,这与我最近提出的一个问题有关,即如果通知设置为启动已在前台的单顶活动,则通知不发送活动信号。