Suggestions to avoid bitmap Out of Memory error

前端 未结 6 1881
一向
一向 2020-11-30 02:29

I am working on an android application. The application has a view containing lots of image. I had an error, I will try to give as much information as possible hoping someon

6条回答
  •  迷失自我
    2020-11-30 02:53

    By Reducing/Scale size of the Image you can get rid out of the Out of Memory Exception, Try this

      BitmapFactory.Options options = new BitmapFactory.Options();
      options.inSampleSize = 6; 
      Bitmap receipt = BitmapFactory.decodeFile(photo.toString(),options);  //From File You can customise on your needs. 
    

提交回复
热议问题