If my app fires a notification and marks it as non-clearing (i.e. tapping it does not remove it), what will result in the notification being removed?
Would I be right in assuming that if the app is shut down by the memory manager that this will cause the notification will be removed? Or will the notification persist even if the app is recycled?
My app needs to show a persistent notification, and I need to understand whether I can set it up in the app, or if I need to build a service to manage it.
When you start a notification with the
FLAG_NO_CLEARit will persist until you cancel it in theNotificationManagerwith a call toNotificationManager.cancel(int notificiationId)I’m not sure what would happen to the notification if your app were uninstalled, although I suspect it would be cleared then too. That said it should be really easy to test. Create an activity that creates a notification. Then close it, kill it, uninstall it, etc… and see what happens.