Code example for DialogFragment

Methods: getTargetFragment, onAttach

0
		return dialog;
	} 
 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		if (getTargetFragment() instanceof OnAuthorIllustratorDialogListener) {
			mAuthorIllustratorCallback = (OnAuthorIllustratorDialogListener)getTargetFragment();
		} 
		else if (activity instanceof OnAuthorIllustratorDialogListener) {
			mAuthorIllustratorCallback = (OnAuthorIllustratorDialogListener)activity;
		} 
	}	 
 
	@Override 
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
 
		final int comicId = getArguments().getInt("ComicId");
		final String[] names = getArguments().getStringArray("Names");