AndroidStudio中找不到MANAGE_EXTERNAL_STORAGE权限
创始人
2024-08-21 09:30:16
0
  1. 首先,打开 AndroidManifest.xml 文件并添加以下代码:

注意:请确保将 android:minSdkVersion 设置为 30 或更高版本。

  1. 然后,打开 build.gradle 文件并将 compileSdkVersion 和 targetSdkVersion 设置为 30 或更高版本:

android { compileSdkVersion 30 buildToolsVersion "30.0.2" defaultConfig { applicationId "com.example.myapp" minSdkVersion 21 targetSdkVersion 30 ...

  1. 最后,在代码中请求 MANAGE_EXTERNAL_STORAGE 权限:

if (Environment.isExternalStorageManager()) { // Permission granted } else { // Request the permission Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); Uri uri = Uri.fromParts("package", getPackageName(), null); intent.setData(uri); startActivityForResult(intent, REQUEST_CODE); }

这将验证用户是否已授予 MANAGE_EXTERNAL_STORAGE 权限。如果没有授予权限,将启动系统意图以请求它。

这样,您应该可以成功请求 MANAGE_EXTERNAL_STORAGE 权限了。

相关内容

热门资讯

透视科普!pokemmo手机版... 透视科普!pokemmo手机版脚本(透视)wepoker私人局透视插件,教程指南书(有挂技巧)-哔哩...
智星德州插件怎么下载!hhpo... 智星德州插件怎么下载!hhpoker德州真的假的(透视)app-本来分享是真的挂1、操作简单,无需智...
透视专业!wepokerplu... 透视专业!wepokerplus辅助(透视)wpk透视是真的吗,教程教材(有挂攻略)-哔哩哔哩1、每...
WePOker有没有透视方法!... WePOker有没有透视方法!aapoker怎么设置提高好牌几率(透视)技巧-总是了解真的是有挂1、...
透视揭露!wepokerplu... 透视揭露!wepokerplus开挂(透视)wpk透视最怕三个东西,教程法子(有挂头条)-哔哩哔哩1...
hhpkoer辅助挂是真的吗!... hhpkoer辅助挂是真的吗!wepoker辅助透视软件(透视)方法-其实专业存在有挂在进入hhpk...
透视关于!hhpkoer辅助器... 透视关于!hhpkoer辅助器视频(透视)hhpoker为什么一直输,教程教材(有挂头条)-哔哩哔哩...
aapoker插件!cloud... aapoker插件!cloudpoker怎么开挂(透视)软件-真是科普是真的挂1、这是跨平台的clo...
透视科普!来玩德州破解器(透视... 透视科普!来玩德州破解器(透视)wepoker透视有用吗,教程学习(有挂助手)-哔哩哔哩1、不需要A...
hhpoker德州透视!pok... hhpoker德州透视!pokemmo手机脚本(透视)app-本来开挂真的是有挂1、完成pokemm...