Code example for DialogFragment

Methods: getActivity, getArguments

0
      return(result);
    } 
 
    @Override 
    public Dialog onCreateDialog(Bundle savedInstanceState) {
      Bundle args=getArguments();
 
      return GooglePlayServicesUtil.getErrorDialog(args.getInt(ARG_STATUS),
                                                   getActivity(), 0);
    } 
 
    @Override 
    public void onDismiss(DialogInterface dlg) {
      if (getActivity() != null) {
        getActivity().finish();
      } 
    } 
  } 
}