when take photo get - java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri()

后端 未结 5 1523
灰色年华
灰色年华 2020-12-05 10:49

The Exception is:

file:// Uri exposed through ClipData.Item.getUri()
java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri()
    at android.         


        
5条回答
  •  孤城傲影
    2020-12-05 11:16

    Besides the solution using the FileProvider, there is another way to work around this. Simply put in Application.onCreate() method. In this way the VM ignores the file URI exposure.

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

提交回复
热议问题