KuzyaTheBrownie
KuzyaTheBrownie

Reputation: 824

Android notification lifecycle

In my app I have notifications which can be showed when application is not running. When I open and close application, notifications disappear.

Is it normal situation? Is there any method to keep notifications?

Upvotes: 0

Views: 1890

Answers (1)

BhanuSingh
BhanuSingh

Reputation: 126

Make sure that there is no any other service or project module, which does the following call NotificationManager.cancelAll() to cancel all the notifications. It is always better to keep the notifications controller over Unique ID and cancel only the notifications which are related to that part, by this the code won't touch the notifications posted by other project parts.

For more reference follow Notification Manager: https://developer.android.com/reference/android/app/NotificationManager.html

Upvotes: 1

Related Questions