android - 使用 accessibilityservice android 获取通知消息

标签 android notifications accessibilityservice

在我的 android 应用程序中,我想显示通知历史记录,因此我想捕获所有通知标题和消息。 我正在使用 accessibilityservice 并且能够使用 parcelable 数据获取标题但无法获取原始消息文本。

如果你有什么理想请帮助我。

最佳答案

我找到了类似的答案 here

另一种方式是——

 Parcelable data = event.getParcelableData();
                if (data instanceof Notification) {
                    Log.d("Tortuga","Recieved notification");
                    Notification notification = (Notification) data;
                    Log.d("Tortuga","ticker: " + notification.tickerText);
                    Log.d("Tortuga","icon: " + notification.icon);
                    Log.d("Tortuga", "notification: "+event.getText());

希望它能帮助您找到解决方案。

关于android - 使用 accessibilityservice android 获取通知消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28712568/

相关文章:

intellij-idea - IntelliJ IDEA : how to get notifications about changes in repository

javascript - Chrome 闹钟无法使用变量?

android - 无障碍服务 : get views you can interact with instantly (same as Voice Access)?

android - AccessibilityService 如何利用其他应用程序?

android - 尝试使用 FragmentActivity 时无法访问 ActivityCompat Api 23

android - Kotlin + MVP - 意外覆盖

java - Android编程,token "Invalid Character"语法错误,删除该token

android - 有没有办法在 Android 的 SQLite Cursor 中添加一行用作分隔符?

ios - 使用 Swift 3 中的日期选择器中的触发日期安排每周可重复的本地通知

android - 使用辅助功能服务 Android 强制停止应用程序?