Bitmap is returning null from BitmapFactory.decodeFile(filename)

前端 未结 14 1116
悲哀的现实
悲哀的现实 2020-11-29 04:19

When I am calling this function there is no image in image view bitmapFactory.decodefile(filename) showing null .. please help for this.

Here is my cod

14条回答
  •  抹茶落季
    2020-11-29 05:00

    Be sure that in your options (BitmapFactory.Options) the InJustDecodeBounds is set to false or otherwise it will return null. This can be set to true when you just want the file to be decoded but you don't need it further in your code. This way no extra memory needs to be allocated. See here for more explanation.

提交回复
热议问题