exposed beyond app through ClipData.Item.getUri

后端 未结 4 959
借酒劲吻你
借酒劲吻你 2020-11-28 03:39

I am trying to fix a problem after the new feature added in Android file system but I get this error:

android.os.FileUriExposedException: file:///storage/emu         


        
4条回答
  •  臣服心动
    2020-11-28 03:58

    add a code in

    onCreate(Budle savedInstancesState){
        if (Build.VERSION.SDK_INT >= 24) {
            try {
                Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
                m.invoke(null);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    

提交回复
热议问题