Example usage for android.support.v4.app DialogFragment dismiss

List of usage examples for android.support.v4.app DialogFragment dismiss

Introduction

In this page you can find the example usage for android.support.v4.app DialogFragment dismiss.

Prototype

public void dismiss() 

Source Link

Document

Dismiss the fragment and its dialog.

Usage

From source file:com.google.plus.samples.photohunt.PlusClientFragment.java

protected void hideProgressDialog() {
    mRequestCode = INVALID_REQUEST_CODE;
    DialogFragment progressDialog = (DialogFragment) getFragmentManager()
            .findFragmentByTag(TAG_PROGRESS_DIALOG);
    if (progressDialog != null) {
        progressDialog.dismiss();
    }/*from w  w w.  j av a2s  .c  om*/
}

From source file:org.sufficientlysecure.keychain.ui.PassphraseDialogActivity.java

@Override
protected void onPause() {
    super.onPause();

    DialogFragment dialog = (DialogFragment) getSupportFragmentManager().findFragmentByTag("passphraseDialog");
    if (dialog != null) {
        dialog.dismiss();
    }//  www .  j a v a  2 s  . co  m
}

From source file:nz.ac.otago.psyanlab.common.designer.program.stage.StageActivity.java

@Override
public void onBackPressed() {
    DialogFragment dialog = ConfirmDialogFragment.newInstance(R.string.title_save_changes, R.string.action_save,
            R.string.action_cancel, R.string.action_discard, new ConfirmDialogFragment.OnClickListener() {
                @Override/*from  ww w .  j ava2  s  . c o  m*/
                public void onClick(Dialog dialog) {
                    onConfirm();
                    finish();
                    dialog.dismiss();
                }
            }, new ConfirmDialogFragment.OnClickListener() {
                @Override
                public void onClick(Dialog dialog) {
                    dialog.dismiss();
                }
            }, new ConfirmDialogFragment.OnClickListener() {
                @Override
                public void onClick(Dialog dialog) {
                    dialog.cancel();
                    finish();
                    dialog.dismiss();
                }
            });
    dialog.show(getSupportFragmentManager(), "ConfirmDeleteDialog");
}

From source file:com.shalzz.attendance.activity.LoginActivity.java

@Override
public void onDialogPositiveClick(DialogFragment dialog) {

    Dialog dialogView = dialog.getDialog();
    final EditText Captxt = (EditText) dialogView.findViewById(R.id.etCapTxt);

    if (data.isEmpty())
        getHiddenData();//w w  w. j ava2s.  c om

    // workaround for enrollment number.
    String sapid = etSapid.getText().toString();
    if (sapid.length() == 10 && sapid.charAt(0) == '#')
        sapid = sapid.replaceFirst("#", "R");

    new UserAccount(LoginActivity.this).Login(sapid, etPass.getText().toString(), Captxt.getText().toString(),
            data);
    Miscellaneous.closeKeyboard(this, Captxt);
    dialog.dismiss();
}

From source file:com.example.scheme.MyPalettesActivity.java

@Override
public void onDeleteDialogPositiveClick(DialogFragment dialog) {

    if (mComplexPrefs != null) {
        mComplexPrefs.removeObject(mTitle.toString());
        PaletteCollection temp_name_arr = mComplexPrefs.getObject("palette_collection",
                PaletteCollection.class);
        temp_name_arr.getCollection().remove(mTitle);
        mComplexPrefs.putObject("palette_collection", temp_name_arr);
        if (temp_name_arr.getCollection().size() == 0) {
            Intent firstPaletteIntent = new Intent(this, FirstPaletteActivity.class);
            startActivity(firstPaletteIntent);
            finish();/*w w  w .j ava2 s.  c  o  m*/
        }
        dialog.dismiss();
        String toast_text = "Deleted palette \'" + mTitle + "\'";
        refresh(toast_text);
    } else {
        android.util.Log.e("pref null", "Preference is null");
    }

}

From source file:com.example.scheme.MyPalettesActivity.java

@Override
public void onRenameDialogPositiveClick(DialogFragment dialog, String name) {
    PaletteModel temp_palette_model = mComplexPrefs.getObject(mTitle.toString(), PaletteModel.class);
    temp_palette_model.setName(name);//from   www .  ja  v  a2  s  .c  om
    mComplexPrefs.removeObject(mTitle.toString());
    mComplexPrefs.putObject(name, temp_palette_model);
    PaletteCollection temp_collection = mComplexPrefs.getObject("palette_collection", PaletteCollection.class);
    temp_collection.getCollection().remove(mTitle.toString());
    temp_collection.getCollection().add(name);
    mComplexPrefs.removeObject("palette_collection");
    mComplexPrefs.putObject("palette_collection", temp_collection);
    dialog.dismiss();
    refresh("Renamed palette to \'" + name + "\'");
}

From source file:net.cloudpath.xpressconnect.screens.ScreenBase.java

protected void removeMyDialog(String paramString) {
      if (this.mInstanceSaved) {
          Util.log(this.mLogger, "Instance has already been saved.  Won't attempt to remove fragment.");
          return;
      }/* w ww  . j a va  2 s .c  o  m*/
      DialogFragment localDialogFragment = (DialogFragment) getSupportFragmentManager()
              .findFragmentByTag(paramString);
      if (localDialogFragment != null) {
          localDialogFragment.dismiss();
          return;
      }
      Util.log(this.mLogger, "Couldn't locate dialog for tag '" + paramString + "'.");
  }

From source file:com.groksolutions.grok.mobile.notification.NotificationListActivity.java

@Override
public void onDialogPositiveClick(final DialogFragment dialog) {
    String tag = dialog.getTag();
    if (tag.equals("dismissAllNotifications")) {
        // Remove in background.
        new AsyncTask<Void, Void, Void>() {
            @Override/*from  w  ww  .  jav  a  2s.  co  m*/
            protected Void doInBackground(Void... v) {
                NotificationService.deleteAllNotifications();
                // Also cancel any pending OS notifications.
                ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).cancelAll();
                return null;
            }

            @Override
            protected void onPostExecute(Void v) {
                dialog.dismiss();
                NotificationListActivity.this.finish();
                finish();
            }
        }.execute();
    } else if (tag.equals("dismissNotification")) {
        removeDoomedNotification();
        dialog.dismiss();
    } else {
        Log.d(TAG, "Unknown dialog click: " + tag);
    }
}

From source file:com.example.scheme.MyPalettesActivity.java

@Override
public void onNewPaletteDialogPositiveClick(DialogFragment dialog, String name) {
    PaletteModel palette = new PaletteModel(name);
    if (mComplexPrefs != null) {
        mComplexPrefs.putObject(name, palette);
        if (mComplexPrefs.getObject("palette_collection", PaletteCollection.class) == null) {
            mComplexPrefs.putObject("palette_collection", new PaletteCollection(name));
        } else {// ww  w .j  a  v a 2 s . c om
            PaletteCollection temp_name_arr = mComplexPrefs.getObject("palette_collection",
                    PaletteCollection.class);
            temp_name_arr.add(name);
            mComplexPrefs.putObject("palette_collection", temp_name_arr);
            mDrawerAdapter.notifyDataSetChanged();
            dialog.dismiss();
            String toast_text = "Created new palette \'" + name + "\'";
            refresh(toast_text);
        }
    } else {
        android.util.Log.e("pref null", "Preference is null");
        dialog.dismiss();
        Toast toast = Toast.makeText(getApplicationContext(), "Error. Try Again.", Toast.LENGTH_SHORT);
        toast.show();
    }
}

From source file:com.shurik.droidzebra.DroidZebra.java

public void dismissBusyDialog() {
    if (mBusyDialogUp) {
        Fragment prev = getSupportFragmentManager().findFragmentByTag("dialog_busy");
        if (prev != null) {
            DialogFragment df = (DialogFragment) prev;
            df.dismiss();
        }/*  w ww.  j ava 2s.  c  o m*/
        mBusyDialogUp = false;
    }
}