Code example for DialogFragment

Methods: getActivity, getArguments, getTargetFragment

0
 
    public void onClick(DialogInterface dialoginterface, int i) {
    	if(-2 == i) {
    		dialoginterface.dismiss();
    	} else if(-1 == i) {
    		String s = getArguments().getString("person_id");
            if(getTargetFragment() instanceof PersonUnblocker)
                ((PersonUnblocker)getTargetFragment()).unblockPerson(s);
            else 
                ((PersonUnblocker)getActivity()).unblockPerson(s);
    	} else { 
    		 
    	} 
    } 
 
    public final Dialog onCreateDialog(Bundle bundle)
    { 
        android.support.v4.app.FragmentActivity fragmentactivity = getActivity();
        boolean flag = getArguments().getBoolean("plus_page");
        android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(fragmentactivity);
        int i;