Android7.0及以上版本拍照报错
exposed beyond app through Intent.getData(),或FileUriExposedException
解决方法:
在Application的onCreat()方法中添加以下代码:
// android 7.0系统解决拍照的问题
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure();
本文介绍了解决Android 7.0及以上版本中使用拍照功能时出现的exposedbeyondappthroughIntent.getData()错误及FileUriExposedException异常的方法。通过在Application的onCreate()方法中添加特定代码,可以有效避免这些问题。
4097

被折叠的 条评论
为什么被折叠?



