重定向到通知访问设置 [英] Redirect to Notification Access Settings

查看:114
本文介绍了重定向到通知访问设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发使用 NotificationListenerService 的Android应用,该应用要求用户在 Setting->下启用我的应用的通知访问权限.安全->通知访问.

I'm currently developing an app for Android that uses the NotificationListenerService, which requires that the user will enable notification access for my app under Setting -> Security -> Notification Access.

我的问题是,我可以将用户重定向到这个地方,以便他们启用它吗?到目前为止,我只设法将它们定向到 Setting->安全性窗口.

My question is that can I redirect the user to this place so they will enable it? So far I only managed to direct them to Setting -> Security window.

还可以先检查用户是否已经为我的应用启用了通知访问权限,然后才将其重定向?

Also, is it possible to first check if the user enabled notification access for my app already and only then redirect them?

推荐答案

您可以使用以下 Intent 打开 NotificationAccessSettingsActivity ,但是我不确定是否要检查查看他们是否已经启用了您的应用.

You can open the NotificationAccessSettingsActivity by using the following Intent, but I'm not sure about checking to see if they've already enabled your app.

startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));

或者,对于API 22 +:

startActivity(new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));

这篇关于重定向到通知访问设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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