检查我的应用程序的通知运行 [英] Check if my application's notification is running
问题描述
有没有一种方法,我可以编程方式检查是否我的应用程序的通知,目前正在运行(如图所示)?
这是说, NotificationManager.notify()
被调用。
有没有一种方法,我可以编程方式检查是否我的应用程序的通知,目前正在运行(如图所示)?
块引用>没有。
这就是说,NotificationManager.notify()被调用
块引用>您名为
通知()
。因此,你已经知道,如果通知()
被调用。你也知道,如果你的code调用取消()
或cancelAll()
。你也知道,通过各种PendingIntents
和标志,如果通知
消失根据用户操作。因此,你把所有的信息自己确定通知
是屏幕上还是不行。不过,精明的开发商会编写自己的应用程序,使得他们不关心,如果他们的
通知
是屏幕上还是不行。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.解决方案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 ifnotify()
was called. You also know if your code callscancel()
orcancelAll()
. You will also know, via the variousPendingIntents
and flags, if theNotification
goes away based upon user action. Hence, you have all of the information yourself to determine if theNotification
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.这篇关于检查我的应用程序的通知运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!