Do we need to explicitly process the bitmap if we do not need it?

The bitmap has a recycle method, but does it need to be explicitly called if it is no longer needed?

For example, ImageView has a bitmap. When the user clicks the button, he will install a new bitmap in the ImageView.

Do I need to process the original bitmap before assigning a new one?

+2
source share
1 answer

yes if you are targeting devices with Android older than 3.0 . This will avoid you in an OutOfMemoryException .

Note. Prior to android 3 bitmap memory is allocated on the native heap. The java object will save low memory in terms of GC.

+3
source

Source: https://habr.com/ru/post/1435538/


All Articles