Android: decodeFile always returns null for file in internal storage

后端 未结 7 1543
长情又很酷
长情又很酷 2020-12-09 16:59

I have a file saved locally into the application\'s private storage. I have verified it exists, however whenever I call BitmapFactory.decodeFile it always retur

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 17:13

    This question has been answered before such as here: BitmapFactory.decodeFile returns null even image exists

    This was exactly what I needed:

    String fname=new File(getFilesDir(), "test.png").getAbsolutePath();
    

提交回复
热议问题