android– 如何以编程方式在应用程序设置中打开应用程序权限窗口

android– 如何以编程方式在应用程序设置中打开应用程序权限窗口,第1张

概述参见英文答案>HowtoprogrammaticallyopenthePermissionScreenforaspecificapponAndroidMarshmallow?                                    11个我正在研究新的权限模型(Android6.0Marshmallow),我想知道有没有办法以编程

参见英文答案 > How to programmatically open the Permission Screen for a specific app on Android Marshmallow?                                    11个
我正在研究新的权限模型(AndroID 6.0 Marshmallow),我想知道有没有办法以编程方式打开应用程序的权限窗口?

不仅是申请细节

我设法用这样的东西打开第二个屏幕

private voID goToSettings() {    Intent myAppSettings = new Intent(Settings.ACTION_APPliCATION_DETAILS_SETTINGS, Uri.parse("package:" + getPackagename()));    myAppSettings.addcategory(Intent.category_DEFAulT);    myAppSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    startActivity(myAppSettings);}

但我不知道如何打开第一个.

非常感谢您的帮助:)

解决方法:

这是不可能的.您可以打开应用程序设置屏幕,但不能打开权限设置屏幕.

有关更多说明,请参阅this question.

我在这里共享代码打开应用程序设置屏幕,

Intent intent = new Intent();intent.setAction(Settings.ACTION_APPliCATION_DETAILS_SETTINGS);Uri uri = Uri.fromParts("package", activity.getPackagename(), null);intent.setData(uri);context.startActivity(intent);

有关更多信息,请参阅Open Application Settings Screen Android

总结

以上是内存溢出为你收集整理的android – 如何以编程方式在应用程序设置中打开应用程序权限窗口全部内容,希望文章能够帮你解决android – 如何以编程方式在应用程序设置中打开应用程序权限窗口所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1097726.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存