Android examples for android.graphics.drawable:Drawable
unbind Drawables
import android.view.View; import android.view.ViewGroup; public class Main { public static void unbindDrawables(View view) { if (view != null) { if (view.getBackground() != null) { view.getBackground().setCallback(null); }//from w ww. j a va2 s . co m if (view instanceof ViewGroup) { for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) { unbindDrawables(((ViewGroup) view).getChildAt(i)); } try { ((ViewGroup) view).removeAllViews(); view.destroyDrawingCache(); return; } catch (Exception exception) { return; } } } } }