Code example for DialogFragment

Methods: getActivity, getArguments, onDismiss

0
		return afb.create();
    } 
	 
	@Override 
	public void onDismiss(DialogInterface dialog) {
		super.onDismiss(dialog);
		if (mNoDismissCall)
			return; 
		FragmentBaseActivity a = (FragmentBaseActivity)getActivity();
        int id = getArguments().getInt(ARG_ID);
		a.onDialogResult(id, Result.CANCEL);
	} 
	 
	@Override 
	public void onClick(View v) {
		FragmentBaseActivity a = (FragmentBaseActivity)getActivity();
        int id = getArguments().getInt(ARG_ID);
		if (v.getId() == R.id.bPos) {
			a.onDialogResult(id, Result.YES);
			mNoDismissCall = true;
			dismiss();