Android 调用相机拍照时报错FileUriExposedException .jpg beyond app through Intent.getData()
2017-11-24 13:12
387 查看
最开始代码是没问题的,在7.0以上调用摄像头就报错,具体什么错我忘了,网上一搜,有解决方案,用provider来获取URI,照做了。
调用摄像头不报错了,但是读取照片又报错了
FileUriExposedException ****.jpg beyond app through Intent.getData()
感觉是权限的问题,但是怎么都找不到问题出在哪,最后在stackoverflow看到一个解决方案:
在Application.onCreate()方法中添加下面的代码:
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
问题解决。
调用摄像头不报错了,但是读取照片又报错了
FileUriExposedException ****.jpg beyond app through Intent.getData()
感觉是权限的问题,但是怎么都找不到问题出在哪,最后在stackoverflow看到一个解决方案:
在Application.onCreate()方法中添加下面的代码:
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
问题解决。
相关文章推荐
- 下载APK后打开APK,在安装时的报错 android.os.FileUriExposedException:exposed beyond app through Intent.getData()
- 安卓7.0遇到 android.os.FileUriExposedException: file:///storage/emulated.. exposed beyond app through Intent.getData()
- Android 调用相机APP获取拍照图片和从相册选择图片
- android 7.0拍照问题file:///storage/emulated/0/photo.jpeg exposed beyond app through ClipData.Item.getUri
- [置顶] Android 7.0 系统解决拍照的问题 exposed beyond app through ClipData.Item.getUri()
- App调用Android设备本地相机拍照并保存到本地相册
- android 7.0拍照问题file:///storage/emulated/0/photo.jpeg exposed beyond app through ClipData.Item.getUri
- android 调用系统相机拍照返回Intent 为空的处理
- Android7.0须知--应用间共享文件(FileProvider) log: exposed beyond app through Intent.getData()
- Android通过Intent方式调用相机拍照取得图片
- android 调用系统相机拍照返回Intent 为空的处理
- android调用系统相机实现拍照功能
- Android7.0 调用相机拍照并裁剪及遇到的坑
- Android调用系统相机拍照,并且模仿实现水印相机简单功能
- android调用系统相册选图或相机拍照后对图片进行剪切无内存溢出支持7.0
- Android调用相机实现拍照并裁剪图片,调用手机中的相册图片并裁剪图片
- Android开发片段–调用系统相机拍照
- 关于android调用相机及拍照的存储和照片处理功能的全面小案例
- Android 调用系统中的相机应用及静默拍照
- android 手机拍照返回 Intent==null 以及intent.getData==null