Code example for DialogFragment

Methods: getDialogonDestroyView, getRetainInstance

0
	// By default, the app will crash if the 
	// hosting activity is destroyed while the dialogfragment is displayed i.e: 
	// during screen reotation 
	@Override 
	public void onDestroyView() { 
		if (getDialog() != null && getRetainInstance())
			getDialog().setOnDismissListener(null);
		super.onDestroyView(); 
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE