简体   繁体   中英

Bring app to the front when notification is clicked

I'm trying to add functionality to my foreground service notification to just open the app when the notification is clicked. I don't want to run any activity - I just want to display the app. Basically I want to achieve same thing that can be achieved in Android by bringing list of apps and clicking on one).

I've checked lots of posts on StackOverflow, but all of them use activity class in Intent, while I don't care about any particular activity - I just want to bring the app up.

You must have a launcher activity right? so you always can start an activity with your launcher activity and use a launch mode in the AndroidManifest.xml to define to bring it up if it already has been created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM