Android 如何拦截状态栏通知? [英] Android How can i intercept the Status Bar Notifications?
问题描述
我想知道我是否可以拦截来自状态栏的通知.这样做的目的是以某种方式拦截传入的 gmail 并用它做一些事情,我真的不需要电子邮件的内容,但它会更好.但是由于 gmail 已经停止了对接收器和数据库的访问,我试图通过监听状态栏来寻找解决方案,如果这可能的话.有什么想法吗?
i would want to know if i can intercept a notification from Status Bar. The purpose of this is to somehow intercept an incoming a gmail and do something with it, i don't really need the content of the email, but it would be nicer. But since gmail had stopped the access to receiver and db, i am trying to find a workaround solution by listen the Status Bar if even this is possible. Any ideas ?
推荐答案
您可以使用来自 API 18 NotificationListenerService
以获取有关 StatusBarNotifications
的通知.
You can use from API 18 NotificationListenerService
to get notified about StatusBarNotifications
.
这篇关于Android 如何拦截状态栏通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!