Android7.0升级版本适配问题
16lz
2021-12-04
1.在manifest文件application标签中中加入
//共享文件权限配置
android:authorities="${applicationId}.fileprovider"
android:name="android.support.v4.content.FileProvider"
android:grantUriPermissions="true"
android:exported="false">
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"/>
注意:
authority:app的包名.fileProvider
grantUriPermissions:必须是true,表示授予URI临时访问权限
export:必须是false
资源:中的@ xml / file_paths是我们接下来要添加的文件
2.在RES目录下新建一个XML文件夹,并且新建一个file_paths的XML文件
path:需要临时授权访问的路径(.代表所有路径)
name:就是你给这个访问路径起个名字
更多相关文章
- android学习之textView布局文件
- Android构建音频播放器教程(四)
- Android快速上手
- TextView 不用 ScrollViewe 也可以滚动
- Android(安卓)5.1 SDK下载与配置
- flutter [!] Android(安卓)toolchain - develop for Android(安
- AndroidManifest.xml文件详解(data)
- [1] Android主要源代码组成
- Android编译过程详解(二)