Context:
My app has 5 activities:
- SplashScreenActivity - starts service
- MainActivity - selects Activity 1,2 or 3
- Activity 1
- Activity 2
- Activity 3
Currently I create notification in onCreate method of the service, which display recent activity after touching, based on
- android How to open last activity when tapping notification
- Resume application and stack from notification
- How to open last activity from notification status bar?
Problem
setOngoing method Notification.Builder is annoying - is always here, independent if my app is in foreground or not. So I change to the setAutoCancel method, but works only for first use. Example:
I run my app - splashscreen activity (notification is shown) -> main activity -> select Activity 1 - minimize. Now click notification - brings Activity 1 (OK), but notification is dismissed and never shown.
Question
How to display notification, every time I minimize app?