Code example for DialogFragment

Methods: onCreate, setCancelable, setRetainInstance

0
	 
	 
	@Override 
	public void onCreate(Bundle savedInstanceState)
	{ 
		super.onCreate(savedInstanceState);
		 
		setCancelable(false);
		setRetainInstance(true);
	} 
	 
	 
	@Override 
	public void onDestroyView() 
	{ 
		// http://code.google.com/p/android/issues/detail?id=17423 
		if(getDialog() != null && getRetainInstance()) getDialog().setDismissMessage(null);
		super.onDestroyView(); 
	}