android webview 遇到android.os.FileUriExposedException错误
来源:互联网 发布:软件开发北京 编辑:程序博客网 时间:2024/06/06 19:32
1. 在 Manifest 文件中添加:
2. 创建 XML 文件: res/xml/provider_paths.xml
3. 把获取文件URI代码替换成新的api:
<manifest ...> <application ...> <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/> </provider> </application></manifest>
2. 创建 XML 文件: res/xml/provider_paths.xml
<?xml version="1.0" encoding="utf-8"?><paths xmlns:android="http://schemas.android.com/apk/res/android"> <external-path name="external_files" path="."/></paths>
3. 把获取文件URI代码替换成新的api:
...imageUri = Uri.fromFile(createImageFile());replace with :File file = createImageFile(); imageUri = FileProvider.getUriForFile(mActivity, mActivity.getPackageName() + ".provider", file);...
阅读全文
2 0
- android webview 遇到android.os.FileUriExposedException错误
- android webview 遇到android.os.FileUriExposedException错误
- android.os.FileUriExposedException 解决方法
- android.os.FileUriExposedException
- android.os.FileUriExposedException
- Android 7.0 android.os.FileUriExposedException
- Android7.0 发生的android.os.FileUriExposedException错误
- Android7.0 android.os.FileUriExposedException
- Android N android.os.FileUriExposedException 注意事项
- android 7.0的android.os.FileUriExposedException: 问题解决
- Android 7.0 报android.os.FileUriExposedException异常
- 解决Android7.0相机 android.os.FileUriExposedException
- Android 打开不同类型的文件及android.os.FileUriExposedException错误处理
- android-解决 Android N 上 报错:android.os.FileUriExposedException
- android-解决 Android N 上 报错:android.os.FileUriExposedException
- 解决 Android N 7.0 上 报错:android.os.FileUriExposedException
- 解决 Android N 上 报错:android.os.FileUriExposedException
- Android N共享文件报错:android.os.FileUriExposedException
- UVa10340
- Codeforces876B-Divisiblity of Differences
- log4j日志配置
- 高精度练习之加法
- 自定义过滤器filter
- android webview 遇到android.os.FileUriExposedException错误
- HTML angular单选按钮
- SQLiteException: not an error (code 0): Could not open the database in read/write mode
- Broadcom BCM94360系列网卡Linux(Ubuntu/Fedora)驱动安装总结
- CNN详解(卷积层及下采样层)
- jmeter测试网站登录
- 子页面与父页面互相调用包括iframe
- js购物车
- 【队内胡策】2017.10.18