Can't compress a recycled bitmap

后端 未结 3 2270
迷失自我
迷失自我 2021-02-19 22:20

I\'m trying to save a Layout into an Image in the SDCard but I get this error. I tried several codes I found in this forum but all of them have the same compress call that is gi

3条回答
  •  心在旅途
    2021-02-19 22:36

    The solution is: you only need to copy the bitmap.

    imageneViewer.setImageBitmap(lienzo.getDrawingCache().copy(Bitmap.Config.RGB_565, false));
    

提交回复
热议问题