kkudi kkudi - 5 months ago 12
Android Question

Check if my application's notification is running

Is there a way I can check programatically whether my app's notification is currently running(shown)?

That is to say that

NotificationManager.notify()
was invoked.

Answer

Is there a way I can check programatically whether my app's notification is currently running(shown)?

No.

That is to say that NotificationManager.notify() was invoked.

You called notify(). Hence, you already know if notify() was called. You also know if your code calls cancel() or cancelAll(). You will also know, via the various PendingIntents and flags, if the Notification goes away based upon user action. Hence, you have all of the information yourself to determine if the Notification is on-screen or not.

However, savvy developers will write their apps such that they do not care if their Notification is on-screen or not.