android.os.FileUriExposedException: file:///storage/emulated/0/Pictures/picFolder/1.jpg exposed beyond app through ClipData.Item.getUri()

后端 未结 2 1579
我寻月下人不归
我寻月下人不归 2021-01-03 08:36

I am trying to take a photo from the phone\'s camera using this code:

activity_main.xml:




        
2条回答
  •  情歌与酒
    2021-01-03 09:08

    Try this! Just paste the below code in activity onCreate()

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

    It will ignore URI exposure

提交回复
热议问题