如何直接打开我的应用程序的“辅助功能设置"? [英] how to open Accessibility Settings of my app directly?

查看:163
本文介绍了如何直接打开我的应用程序的“辅助功能设置"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如此处所述:如何在Android中启动我的APP的辅助功能设置"页面?我可以使用以下代码直接打开应用的辅助功能设置":

As mentioned here: How can I start the Accessibility Settings Page of my APP in Android? I can open my app Accessibility Settings directly with this code:

Intent intent = new Intent();
        intent.setClassName("com.android.settings",
                "com.android.settings.Settings");
        intent.setAction(Intent.ACTION_MAIN);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                | Intent.FLAG_ACTIVITY_CLEAR_TASK
                | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
        intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT,
                "the fragment which you want show");
        intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS,
                extras);
       startActivity(intent);

但是我测试了很多东西,例如应用程序名称,程序包名称,服务类名称等,而不是您要显示的片段",但没有用.

but I tested many things like app name, package name, service class name and etc instead of "the fragment which you want show" but does not worked.

推荐答案

它只能在kitkat 4.4以下运行.此漏洞问题已在4.4及更高版本中解决.可访问性权限是至关重要的权限之一,而android不允许您直接访问该应用程序页面,因为目前只有打开可访问性服务的方法是

It work below kitkat 4.4 only. This vulnerability issue is resolve in 4.4 and above. Accessibility permission is one of the crucial permission and android not allow you to directly access that app page as of now there is only way to open Accessibility service is

startActivity(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS))

然后,如果用户想允许其权限,则可以选择您的应用

And then user can choose your app if he want to allow permission

这篇关于如何直接打开我的应用程序的“辅助功能设置"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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