
参见英文答案 > 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 – 如何以编程方式在应用程序设置中打开应用程序权限窗口所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)