PendingIntent from second action overwrites the first action and the contentIntent for Notification

From the doc:

Because of this behavior, it is important to know when two Intents are considered to be the same for purposes of retrieving a PendingIntent. A common mistake people make is to create multiple PendingIntent objects with Intents that only vary in their "extra" contents, expecting to get a different PendingIntent each time. This does not happen. The parts of the Intent that are used for matching are the same ones defined by Intent.filterEquals. If you use two Intent objects that are equivalent as per Intent.filterEquals, then you will get the same PendingIntent for both of them.

So you have to make those intents different as in Intent.filterEquals method:

That is, if their action, data, type, class, and categories are the same. This does not compare any extra data included in the intents.

As a side note, I had the same problem while working on the download notifications of firefox for android here


Hence PendingIntent.FLAG_UPDATE_CURRENT flag will just overwrite the extras if you are creating new intent where only the extras change.

Try adding distinct

  • action like intent.setAction("DISTINCT.ACTION.HERE") or
  • category like intent.addCategory("DISTINCT.CATEGORY.HERE")

for each intents.

cheers :-)