How to show image from Gallery to ImageView?

二次信任 提交于 2019-12-06 10:35:40

Maybe BitmapFactory.decodeFile(picturePath) returns null. Check it. And check if you added permissions in AndroidManifest.xml:

android.permission.WRITE_EXTERNAL_STORAGE
android.permission.READ_EXTERNAL_STORAGE

BitmapFactory.decodeFile(String filePath) in documentation: http://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeFile(java.lang.String)

Returns: the resulting decoded bitmap, or null if path is null or could not be decoded.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!