android 7.0权限 融云下调用相机报错

Unable to start activity ComponentInfo{com.zifan.zhihuichengguan/io.rong.imkit.widget.provider.TakingPicturesActivity}: android.os.FileUriExposedException: file:///storage/emulated/0/Pictures/1529630577760.jpg exposed beyond app through ClipData.Item.getUri()

Application的onCreat()方法中添加以下代码:

// android 7.0系统解决拍照的问题

StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();

StrictMode.setVmPolicy(builder.build());

builder.detectFileUriExposure();

 

转载于:https://www.cnblogs.com/qianxiaojinnian/p/9211976.html

你可能感兴趣的:(移动开发)