监听在Android的通知 [英] Listening for Notification on Android

查看:114
本文介绍了监听在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆