Code example for Fragment

Methods: getView, onDestroyView

0
		} 
	} 
 
	@Override 
	public void onDestroyView() { 
		unbindDrawables(getView());
		super.onDestroyView(); 
	} 
 
	public static void unbindDrawables(View view) {
		try { 
			if (view != null) {
				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();
				}