Search code examples
androidgoogle-cloud-messagingandroid-pendingintent

PendingIntent not working on notification


I am showing multiple notifications, each notification with its own id, so all notifications are properly shown. My problem is that when clicking on the last notification, the PendingIntent used is the first one instead of the last one. I don't understand why this is happening as I'm using the FLAG_ONE_SHOT. This is the piece of code:

final PendingIntent pendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_ONE_SHOT);
notificationBuilder.setContentIntent(pendingIntent);

Thanks in advance!


Solution

  • change your pending intent id. use different one in place of 0