Bonjours à tous,
J'essaie, au clic sur un élément d'une liste, de télécharger un fichier. Lorsque que ce fichier est téléchargé, une notification s'affiche et au clic dessus, l'image s'ouvre.
Mon problème est que, après la première notification, les notifications suivantes ouvrent le même fichier. Par exemple, si je télécharge 1.jpg, 2.jpg, 3.jpg, quelque soit celui que j'ouvre, le getIntent().getExtras().get("file").toString() me retourne la valeur 1.jpg (alors que la notification est bien envoyée avec l'intent 2,3....).
Pour info, j'aimerai une notification séparée par fichier (et pas une seule notification avec le dernier fichier).
Voici une partie de mon code :
Si quelqu'un peut m'indiquer ce que je fais faux, c'est bien volontiers.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 Intent notificationIntent = new Intent(this, ImageViewer.class); notificationIntent.putExtra("file", file); Notification notification = new Notification(icon, ticker, System.currentTimeMillis()); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); notification.setLatestEventInfo(context, title, content, contentIntent); mNotificationManager.notify(++NOTIFICATION_ID, notification);
Merci d'avance !!!
Partager