Code example for DialogFragment

Methods: getArguments, getTargetFragment, onCreate, setCancelable

0
	 
	 
	@Override 
	public void onCreate(Bundle savedInstanceState)
	{ 
		super.onCreate(savedInstanceState);
		 
		setCancelable(true);
		 
		// handle fragment arguments 
		Bundle arguments = getArguments();
		if(arguments != null)
		{ 
			handleArguments(arguments);
		} 
		 
		// set callback listener 
		try 
		{ 
			mListener = (DatePickerDialogListener) getTargetFragment();
		} 
		catch(ClassCastException e)
		{ 
			throw new ClassCastException(getTargetFragment().toString() + " must implement DatePickerDialogListener");
		} 
	} 
	 
	 
	@Override