Mit Benachrichtigung App in Vordergrund holen

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

netfreak
  • netfreak
Antworten
10
Aufrufe
457
netfreak
netfreak
D
Antworten
23
Aufrufe
2.542
Data2006
D
R
  • Robby1950
2
Antworten
23
Aufrufe
1.015
Robby1950
R
Zurück
Oben Unten