现在android 9.0是如何读取外置SD卡权限的?我试过动态和静态申请都不行,在线等,急急急~
听别人说用DocumentUI,这个怎样用,网上搜到的方法很少~
方法已解决:因为android 9.0访问的方式不同了,换个访问方式,可以使用DocumetUi去解决,因为项目紧急,我还没有深入去研究,用了别的方式去访问,代码如下:
File file = null;
for (File files : mContext.getExternalFilesDirs(Environment.DIRECTORY_DOWNLOADS)) {
if (Environment.isExternalStorageRemovable(files)) {
file = files; }
}
if (null == file) {
throw new UnsupportedOperationException();
}
return file == null ?
null : file.getAbsolutePath();
链接:https://blog.csdn.net/qq_32072451/article/details/78066504,csdn里有提供很多方法,可以试试
[运行时权限] https://blog.csdn.net/sxt_zls/article/details/53907803 ""
请问 ,在Android 9.0 中 多用户模式下,切换为访客用户,sd卡的访问权限 用楼主你的方法 可以做到吗?