【发布时间】:2017-07-07 00:28:46
【问题描述】:
我在使用 NotificationListener 服务时遇到了两个问题
- 我在我的应用程序中使用了 NotificationListenerService 类。此侦听器#onNotificationPosted 方法接收所有通知。
我的代码如下所示
public class MyListener extends NotificationListenerService
{
public void onNotificationPosted(StatusBarNotification statusBarNotification)
{
//Receive all notification.
// I need to receive reminder notification only
}
//.....
......
}
//My Manifiest like below
<service
android:name=".MyListener"
android:enabled="true"
android:label="@string/app_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService"/>
</intent-filter>
</service>
但我只需要接收日历提醒通知。
如何添加过滤器只接收日历提醒通知?
-
当我打开通知访问时,它会显示以下消息
允许 MyApp 访问通知?
MyAPP 将能够读取所有通知,包括个人通知 联系人姓名和您发送的消息文本等信息 收到。它还可以关闭通知或触发操作 它们包含的按钮
如何在通知访问对话框中更改上述消息?
【问题讨论】:
标签: java android notifications calendar