Sid Verma Sid Verma - 1 month ago 9
Android Question

Multiple Pending Intents?

My activity creates a couple of notifications.

Here's how I'm currently doing it, on different resultIntents:

PendingIntent resultPendingIntent =
PendingIntent.getActivity(
context,
0,
resultIntent,
PendingIntent.FLAG_UPDATE_CURRENT
);


Now, since a flag is compulsory, I'm forced to select from the four flags. What do I do if I want all of them to work independently, and the newer notification isn't affected by the previous one.

Answer Source

A solution was found here: here.

You've to use setAction on the intent to a unique value so that there will be no matching PendingIntents

Here's what I used:

setAction(Long.toString(System.currentTimeMillis()))