I’m setting up a Notification with some data to open up one of my activities. If the notificatio hasn’t been acknowledged yet, I’m overwriting it it with since i’m calling notifiy with the same ID.
I’m seeing the notificaiton values change, however, i’m noticing that the extra value i’m putting in to the ReceiveMessage key in the putExtra call actually has stale information.
NOtificaitonManager.notify is supposed to ovewrite an existing notification with that ID, so why am I processing stale information in the Notification’s Intent?
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);
Use
PendingIntent.FLAG_UPDATE_CURRENTin your call togetActivity().