Salut, j'ai créé une intention de notification comme suitnotification GCM Android ne redirige pas l'activité onformément lorsque l'application est en arrière-plan
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(getNotificationIcon())
.setContentTitle(title)
.setContentText(text)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
int notification_id = (int) System.currentTimeMillis();
notificationManager.notify(notification_id, notificationBuilder.build());
Tout fonctionne parfaitement si l'application est fermée. Mais si l'application fonctionne en arrière-plan, elle affiche simplement la dernière activité ouverte de l'arrière-plan au premier plan. Je veux aller à la page exacte reçue dans les données. Quelqu'un m'a aidé, j'ai essayé plusieurs combinaisons de FLAGS
.
essayez cette intention.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); –
Ajoutez votre code manifeste pour l'activité que vous voulez démarrer lors de la notification. –
Veuillez poster votre manifeste –