Détruire toutes les activités précédentes
Bonjour,
Lorsque je clique sur une notification lié à mon application j'aimerais que toutes les activités ouvertes (liées à cette même appli) soient détruites. J'ai essayé ceci, mais cela ne marche pas. Auriez-vous une solution ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(icon, message, when);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notificationManager.notify(ID_NOTIF, notification); |