Multiple notifications to the same activity Multiple notifications to the same activity android android

Multiple notifications to the same activity


If the PendingIntent has the same operation, action, data, categories, components, and flags it will be replaced.

Depending on the situation i usually solve this by providing a unique request code either as static values (0,1,2) or the row id of the data I'm receiving from the DB.

PendingIntent.getActivity(context, MY_UNIQUE_VALUE , notificationIntent, PendingIntent.FLAG_ONE_SHOT);

Then I use the same unique value for notify() as

mNotificationManager.notify(MY_UNIQUE_VALUE, notification);