in my app I'm creating 3 notifications (with id 0,1, 2) depending on some data.
I use
 setCancel(true);
on the notification in order to let the system cancel it on user click. I would like to cancell all the notifications (id 0,1,2) on the userclick on one of them. Is this possible?
This is my code about notification creation:
    NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    Intent notificationIntent = new Intent(context, ActivityMain.class);
    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
    Notification.Builder builder = new Notification.Builder(context);
    Notification notification = null;
    builder.setContentTitle(title)
           .setContentIntent(contentIntent);
    notification = new Notification.BigTextStyle(builder).bigText(mex).build();
    notificationManager.notify(id, notification);
 
                        
Take a look at the NotificationManager#cancelAll method