Code example for DialogFragment

Methods: isAdded, onDestroy

0
  private BroadcastReceiver c;
  private p d;
 
  private void a() 
  { 
    if ((this.b != null) && (isAdded()))
      this.b.hide();
    this.a = false;
    this.b = null;
  } 
 
  private void a(Context paramContext)
  { 
    a(); 
    if (isAdded())
    { 
      this.b = new ProgressDialog(paramContext);
      this.b.setMessage(getString(z.U));
      this.b.setCancelable(false);
      this.b.show();
    } 
    this.a = true;
  } 
 
  private void a(boolean paramBoolean)
  { 
    a(); 
    RecoveryResultDialog localRecoveryResultDialog = new RecoveryResultDialog();
    Bundle localBundle = new Bundle();
    localBundle.putBoolean("result", paramBoolean);
    localRecoveryResultDialog.setArguments(localBundle);
    localRecoveryResultDialog.show(getFragmentManager(), "recovery_result_dialog");
    dismiss();
  } 
 
  public void onActivityCreated(Bundle paramBundle)
  { 
    super.onActivityCreated(paramBundle);
    if (this.a)
      a(getActivity());
  } 
 
  public void onCreate(Bundle paramBundle)
  { 
    super.onCreate(paramBundle);
    if (paramBundle != null)
      this.a = paramBundle.getBoolean("progress_showing", false);
    this.c = new c(this);
    this.d = p.a(getActivity());
    this.d.a(this.c, new IntentFilter("com.avast.android.generic.app.passwordrecovery.ACTION_NEW_STATE"));
  } 
 
  @TargetApi(8) 
  public Dialog onCreateDialog(Bundle paramBundle)
  { 
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(al.d(getActivity()));
    localBuilder.setTitle(getString(z.Z));
    localBuilder.setMessage(z.bW);
    localBuilder.setPositiveButton(z.O, new d(this));
    localBuilder.setNegativeButton(z.e, new e(this));
    AlertDialog localAlertDialog = localBuilder.create();
    localAlertDialog.setInverseBackgroundForced(true);
    localAlertDialog.setOnShowListener(new f(this, localAlertDialog));
    return localAlertDialog;
  } 
 
  public void onDestroy() 
  { 
    super.onDestroy(); 
    this.d.a(this.c);
    a(); 
  } 
 
  public void onSaveInstanceState(Bundle paramBundle)
Connect your IDE to all the code out there  Get Codota for Java