Code example for DialogFragment

Methods: onAttach

0
		return builder.create();
	} 
 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		if(!(activity instanceof CheddarPlusDialogListener)) {
			throw new IllegalStateException("Activity must implement fragment's callbacks.");
		} 
		mListener = (CheddarPlusDialogListener)activity;
	} 
}