Bitmap is returning null from BitmapFactory.decodeFile(filename)

前端 未结 14 1122
悲哀的现实
悲哀的现实 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 04:56

    Delete "options.inJustDecodeBounds = true;" if you have

      val options =  BitmapFactory.Options();
      //options.inJustDecodeBounds = true; //delete this line
      var bitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), options);
    

提交回复
热议问题