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

后端 未结 4 2229
悲哀的现实
悲哀的现实 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:49

    I think you are entering SD card path manually. Instead of manually entering SD Card path you should get storage path like this :

    File extStore = Environment.getExternalStorageDirectory();
    String mPath = extStore.getAbsolutePath() + "/mydir/bgs";
    

提交回复
热议问题