Java tutorial
//package com.java2s; import android.graphics.drawable.BitmapDrawable; import android.widget.ImageView; public class Main { public static void cleanImageView(ImageView imageView) { if (!(imageView.getDrawable() instanceof BitmapDrawable)) return; //Clean up the view's image for the sake of memory BitmapDrawable b = (BitmapDrawable) imageView.getDrawable(); b.getBitmap().recycle(); imageView.setImageDrawable(null); } }