Bitmap is returning null from BitmapFactory.decodeFile(filename)

前端 未结 14 1150
悲哀的现实
悲哀的现实 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:17

    Why are you doing this String imageInSD = "/sdcard/UserImages/"+userImageName;

    I think If you get a .png file is present then just,

     Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
    

    NOTE: Also check you have a Android supported image file is present in that location..

提交回复
热议问题