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:就是你给这个访问路径起个名字

更多相关文章

  1. android学习之textView布局文件
  2. Android构建音频播放器教程(四)
  3. Android快速上手
  4. TextView 不用 ScrollViewe 也可以滚动
  5. Android(安卓)5.1 SDK下载与配置
  6. flutter [!] Android(安卓)toolchain - develop for Android(安
  7. AndroidManifest.xml文件详解(data)
  8. [1] Android主要源代码组成
  9. Android编译过程详解(二)

随机推荐

  1. 查看Android中支持的linux命令
  2. android之定时器AlarmManager .
  3. android项目开发流程
  4. 开发Android主攻四大方向
  5. 史上最好用的Android省市区选择,三级联动
  6. Android(安卓)Support兼容包详解
  7. Android Studio获取SHA1值
  8. android 在myeclipse中查看源码
  9. Android(安卓)OpenGL ES学习笔记之绘制线
  10. smem在Android中的使用