监听在Android的通知 [英] Listening for Notification on Android
问题描述
我有一些疑问,当涉及到通知的机器人编程。我已阅读了就notificationmanager,通知和notificationbuilder,但它似乎并没有让它侦听通知。
I have some queries when it comes to notification on android programming. I have read up on the notificationmanager, notification and notificationbuilder but it doesn't seem to allow it to listen for notifications.
我所要做的是当一个通知发送给任何应用程序,我就能知道它的内容。是实际可能,如何能不能做到?
What I am trying to do is when a notification is send by any application, I will be able to know the contents of it. Is that actually possible and how can it be done?
推荐答案
通过API级别18日发布,现在有一个NotificationListenerService。 <一href="http://developer.android.com/reference/android/service/notification/NotificationListenerService.html" rel="nofollow">http://developer.android.com/reference/android/service/notification/NotificationListenerService.html
With API level 18 release, there is now a NotificationListenerService. http://developer.android.com/reference/android/service/notification/NotificationListenerService.html
这篇关于监听在Android的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!