android 7.0调用相机 崩溃

错误代码:

 android.os.FileUriExposedException: file:///storage/emulated/0/photo.jpeg exposed beyond app through ClipData.Item.getUri()
 
  

解决办法:
ApplicationonCreat()方法中添加以下代码:

StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
        StrictMode.setVmPolicy(builder.build());
        builder.detectFileUriExposure(); 



你可能感兴趣的:(android 7.0调用相机 崩溃)