监听在Android的通知通知、Android

2023-09-06 04:08:33 作者:心慈则手软??

我有一些疑问,当涉及到通知的机器人编程。我已阅读了就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。 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