Java 通过任何标记或id使用NotificationManager获取通知
在我的应用程序中,我需要从通知栏检测特定的通知,如果检测到通知,则打开一些意图。我知道有一种notificationManager的activeNotifications方法,我想在23下面的API中这样做。有没有办法从通知栏中识别通知 使用Java 通过任何标记或id使用NotificationManager获取通知,java,android,Java,Android,在我的应用程序中,我需要从通知栏检测特定的通知,如果检测到通知,则打开一些意图。我知道有一种notificationManager的activeNotifications方法,我想在23下面的API中这样做。有没有办法从通知栏中识别通知 使用NotificationManager.getActiveNotifications()获取所有当前通知 根据文件: publicStatusBarNotification[]getActiveNotifications()Recover a 活动通知列表:
NotificationManager.getActiveNotifications()
获取所有当前通知
根据文件:
publicStatusBarNotification[]getActiveNotifications()
Recover a
活动通知列表:已由
正在调用的应用程序尚未被用户或
cancel(String,int)
。每个通知都嵌入到一个
StatusBarNotification对象,包括原始标记和id
提供给notify()
(通过getTag()
和getId()
)以及
原始通知对象(通过
StatusBarNotification.getNotification()
)
其可从API级别23获得
请参阅:但我想检测API<23中的通知。你能给我推荐一种低于23的API的方法吗?你找到了吗@阿利哈姆扎尤布13