We have an android application which has stacked notifications being pushed when multiple new messages come up. When a particular message's action button is clicked in expanded view all the messages gets cleared out from notification tray although we are passing the notification manager the specific id for which the notification has to be cleared
Code for clearing pending notification:
notificationManager.cancel(notificationID);
Code for creating a pending intent:
PendingIntent.getBroadcast( context, message.getMessageId().hashCode(), intent, IntentHelper.getPendingIntentFlagUpdateCurrent(true));
public static int getPendingIntentFlagUpdateCurrent(boolean isMutable) { return isMutable ? (PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE) : (PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); }
I am unsure of what the reason might be for all the notifications to get removed.