jjzjj

NotificationListenerService

全部标签

android - NotificationListenerService 不读取堆叠通知的文本

我希望这不会违反任何规则,因为我已尝试遵循如何提问指南。我正在尝试使用NotificationListenerService读取传入的通知,它对我有用,但只是部分有用。它的第一个通知类型,比方说-whatsapp我可以获得代码、文本和标题,但如果通知堆积起来,我将无法再阅读消息的文本。如何获取堆叠通知的文本?这是我目前实现的代码:publicclassNotificationServiceextendsNotificationListenerService{privateContextcontext;@OverridepublicvoidonCreate(){super.onCreat

android - 访问 Android NotificationListenerService 设置

Android从4.3开始有一个新的通知监听器服务:http://developer.android.com/about/versions/jelly-bean.htmlhttp://developer.android.com/reference/android/service/notification/NotificationListenerService.html来自文档:Notificationaccessisdisabledbydefault—appscanuseanewIntenttotaketheuserdirectlytotheSettingstoenablethelis

android - 为什么这个 NotificationListenerService 不工作

我在对抗NotificationListenerService时运气不佳。我尝试了很多在这里和那里找到的食谱,尤其是关于……但它的效果很不一致。先看代码:list:然后是服务本身:publicclassNLServiceextendsNotificationListenerService{privateStringTAG="NLService";//bindandunbindseemstomakeitworkwithAndroid6...//butisnevercalledwithAndroid4.4...@OverridepublicIBinderonBind(IntentmInte

java - NotificationListenerService : NullPointerException on getActiveNotifications

我正在尝试根据本教程在我的应用程序中实现NotificationListenerService:http://www.kpbird.com/2013/07/android-notificationlistenerservice.html,但我在调用getActiveNotifications时遇到NullPointerException。Causedby:java.lang.NullPointerExceptionatandroid.os.Parcel.readException(Parcel.java:1437)atandroid.os.Parcel.readException(Pa

android - 无法让 NotificationListenerService 类工作

我有一个android应用程序正在尝试使用api18中的新NotificationListenerService类。我创建了自己的服务类,该类继承自此类并覆盖了onNotificationPosted和onNotificationRemoved事件,尽管我的服务似乎可以正常启动这些当我收到或删除通知时,似乎从未调用2个事件。有没有人在这个类上取得过任何成功,或者他们愿意分享的任何源代码来展示如何使用这个类? 最佳答案 根据我的经验,几乎所有这些答案都非常接近正确的解决方案!CORE问题似乎是在开发过程中出现的;在您开发代码时,当您在

android - NotificationListenerService 实现

我正在尝试实现在android4.3中添加的NotificationListnerService,但我无法获取通知详细信息。我的代码如下publicclassMainActivityextendsActivity{@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);NotificationCompat.BuildermBuilder=newNotificationCompat.B

android - 使用 NotificationListenerService 检查对通知的访问

我正在使用>=4.3NotificationListenerService来访问通知。在第一次启动时,我的应用程序将用户带到“访问通知”系统面板,但只要禁用了“访问通知”中我的应用程序的复选框,我想将用户带到那里。我在任何地方都没有找到isNotificationAccessEnabled()方法,但我绝对知道这是可能的,因为像Krome这样的应用程序也这样做。 最佳答案 2016年6月15日编辑我不确定thesupportlibrary的哪个版本这是添加到的,但现在看起来这个功能是内置的。只需使用:NotificationMana