ImageView v = (ImageView) _________;
((BitmapDrawable) v.getDrawable()).setCallback(null);
Usually you do it on onDestroy()
private void unbindDrawables(View view) {
if (view.getBackground() != null) {
view.getBackground().setCallback(null);
}
if (view instanceof ViewGroup) {
for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
unbindDrawables(((ViewGroup) view).getChildAt(i));
}
((ViewGroup) view).removeAllViews();
}
}
For Bitmap, you use recycle().
No comments:
Post a Comment