For example, in my Activity I have such code (I skip the initialization of variables):
ImageView iview; //some ImageView
Bitmap b; //some Bitmap
iview.setImageBitmap(b);
Question is - how to clear iview resources correctly (with or without destroying view) ? Would ImageView free it's resources (used in native code) after b.recycle()
?
I suppose, that ImageView doesn't just free it resources after Activity onStop
(or onDestroy
).
imgview.setImageResource(0);
or
imgview.setImageDrawable(null);
no you need to unbindDrawables, you can do it by setting iview.setImageDrawable(null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With