Skip to content Skip to sidebar Skip to footer

Why Extra Data (integer) Is Not Sent In Android Notification Intent?

The following code to display a notification and send int data, but in the other activity getExtras() returns null. Why? int notificationID = 1; NotificationManager nm = (Notificat

Solution 1:

Probably the PendingIntent exists already and was not created, but reused. Try to create it with the PendingIntent.FLAG_UPDATE_CURRENT flag:

PendingIntentcontentIntent= PendingIntent.getActivity(getApplicationContext(), 0, i, PendingIntent.FLAG_UPDATE_CURRENT);

See https://stackoverflow.com/a/9330144/530804 and the other answer on that question.

Post a Comment for "Why Extra Data (integer) Is Not Sent In Android Notification Intent?"