Android: decodeFile always returns null for file in internal storage

后端 未结 7 1556
长情又很酷
长情又很酷 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条回答
  •  Happy的楠姐
    2020-12-09 17:27

    You need to setup run-time permissions for Manifest.permission.READ_EXTERNAL_STORAGE If you don't you'll get a null without getting any error message or even an indication in the Log. Note that you need to request the permissions both in the Manifest and at run time.

提交回复
热议问题