Android: decodeFile always returns null for file in internal storage

后端 未结 7 1542
长情又很酷
长情又很酷 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:32

    BitmapFactory.decodeFile expects a file path without the scheme. I.e. without the file:// in the beginning.

    If you're handling a Uri, don't just .toString() it, but instead call .getPath() on it, and pass that to the method.

    0 讨论(0)
提交回复
热议问题