简体   繁体   中英

Not show notification in status bar if app is running

I am implementing an android app that uses a service which posts notifications. I only want to display the notifications after the user has closed the app. Is it possible to not show notification in status bar if app is running?

You can work it around:

You could notify your service when the app has started (from the app), so it can remove the Notification instance.

The same, when your application has been closed by the user, before explicitly finishing the current activity, the app will notify the service to show the notification again.

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