Android examples for User Interface:ImageView
Set null to ImageView.
//package com.java2s; import android.widget.ImageView; public class Main { /**/*from ww w. j a va2 s . co m*/ * Set null Image view. * * @param view * The {@link ImageView} */ public static void setNullViewDrawable(ImageView view) { // remove resource of View. if (view != null) { if (view.getDrawable() != null) { view.getDrawable().setCallback(null); } if (view.getBackground() != null) { view.getBackground().setCallback(null); } view.setImageDrawable(null); view.getResources().flushLayoutCache(); view.destroyDrawingCache(); view.setBackgroundDrawable(null); view.setBackgroundResource(0); view = null; } } }