android - NotificationListenerService 中的代码文本为 null

标签 android notifications

我在写 NotificationListenerService ,
我想在其中获取发送到状态栏的通知的详细信息。
但我们唯一得到的是 Ticket text ,在某些情况下它是 null。

最佳答案

正确,在构建通知时,代码文本不是必填字段。事实上,唯一的 required notification contents是:

不幸的是,extras 包仅在 Android 4.4 (KitKat) 设备上可用 - 以前的版本无法轻松访问此数据 - 您只能访问 RemoteViews,您需要手动对其进行扩充和解析(绝对不推荐)。

关于android - NotificationListenerService 中的代码文本为 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21934979/

相关文章:

java - 使用 Android 通知时出现运行时异常。

android - Android 8 上不显示通知

iphone - 如何在另一个 View Controller 中调用 NSNotificationCenter 函数?

java - UDP 数据包在 Java 中接收正常,但在 Python 中损坏

android - ACCESS_COARSE_LOCATION 不适用于 Android 6

java - 带有子 fragment 的 fragment backstack

javascript - Chrome 的网络推送通知

ruby-on-rails - 向 Rails 中的用户发送评论通知?

android布局对齐textview和button

android - 微调器错误