Mit Benachrichtigung App in Vordergrund holen

  • 4 Antworten
  • Letztes Antwortdatum
I

Inuyashaxp

Neues Mitglied
0
Hallo zusammen,

hab in meine App Status Bar Notifications eingebaut, wenn ich jetzt allerdings auf die Benachrichtigung klicke und das Intent ausgeführt wird läd er meine App neu anstatt sie einfach ausm Hintergrund zu holen und wieder anzuzeigen.

Kann mir wer sagen wie ich das ändere?

Intent notificationIntent = new Intent(this, MyClass.class);
Grüße
Inu
 
Gib dem Intent nur das "FLAG_ACTIVITY_REORDER_TO_FRONT"-Flag mit.

Das sollte reichen :biggrin:
 
Danke !

is das so richtig? Weil er machts noch nicht xD

Code:
Intent notificationIntent = new Intent(this, MyClass.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
 
Ja, du muss den Intent ja noch auslösen:

Code:
Intent notificationIntent = new Intent(this, MyClass.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(notificationIntent);
 
sem_thesis schrieb:
Ja, du muss den Intent ja noch auslösen:

Code:
Intent notificationIntent = new Intent(this, MyClass.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(notificationIntent);

Das macht doch der PendingIntent, den er in die Notification packt. ;)
 

Ähnliche Themen

G
Antworten
0
Aufrufe
132
Gerdchen07
G
G
Antworten
1
Aufrufe
384
Gerdchen07
G
G
Antworten
13
Aufrufe
599
Gerdchen07
G
L
Antworten
2
Aufrufe
555
Lexub
L
migi01
Antworten
26
Aufrufe
1.995
migi01
migi01
Zurück
Oben Unten