Android - Unable to open content: file:///storage/emulated/0

后端 未结 4 2297
悲哀的现实
悲哀的现实 2020-12-31 03:58

I\'ve a widget with nine-patch image background. The image was saved in /sdcard/mydir/bgs.

When I try to load a image with setImageViewUri method, I\'ve this error:<

4条回答
  •  滥情空心
    2020-12-31 04:42

    As from Lollipop, Google introduced a new way of explicitly giving apps the permission you want them to use on your device and disabling the ones you want to deny the app. If you notice, in your android monitor, the log shows

    java.io.FileNotFoundException: /storage/emulated/0/advert.mp4: open failed: EACCES (Permission denied)
    

    EACCESS permission denied is the cause of the java's infamous FileNotFoundException.

    To solve this, just goto your App permission and enable storage for your app

提交回复
热议问题