问题描述
限时送ChatGPT账号..我有一个关于新的 Android 6.0 (Marshmallow) 版本的问题:
I have a question regarding the new Android 6.0 (Marshmallow) release:
是否可以通过 Intent 或类似方式显示特定应用的权限屏幕?
Is it achievable to display the permission screen for a specific app via an Intent or something similar?
可以使用以下代码显示应用设置 - 是否有直接打开权限屏幕的模拟解决方案?
It's possible to display the app settings with the following code - is there an analog solution for directly opening the permission screen?
startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", getPackageName(), null)));
我已经对此进行了一些研究,但找不到合适的解决方案.
I already did some research on this, but I wasn't able to find a proper solution.
推荐答案
根据官方 Marshmallow 权限视频(位于 4m 43s 标记),您必须改为打开应用程序设置页面(从那里单击到权限页面).
According to the official Marshmallow permissions video (at the 4m 43s mark), you must open the application Settings page instead (from there it is one click to the Permissions page).
要打开设置页面,你会这样做
To open the settings page, you would do
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
startActivity(intent);
这篇关于如何在 Android 6.0 (Marshmallow) 上以编程方式打开特定应用程序的权限屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论