Example usage for android.app DialogFragment dismiss

List of usage examples for android.app DialogFragment dismiss

Introduction

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

Prototype

public void dismiss() 

Source Link

Document

Dismiss the fragment and its dialog.

Usage

From source file:com.mediatek.galleryfeature.stereo.fancycolor.FancyColorActivity.java

private void hideLoadingProgress() {
    if (mLoadingProgressDialog != null) {
        DialogFragment fragment = mLoadingProgressDialog.get();
        if (fragment != null) {
            fragment.dismiss();
            MtkLog.d(TAG, "<hideLoadingProgress>");
        }//from   w  ww .  j  av a 2 s  . co  m
    }
}

From source file:by.zatta.pilight.MainActivity.java

private void closeDialogFragments() {
    FragmentManager fm = getFragmentManager();
    DialogFragment prev = (DialogFragment) fm.findFragmentByTag("dialog");
    if (prev != null) {
        prev.dismiss();
    }//  w ww  . j a va  2 s .c o  m
}

From source file:by.zatta.pilight.MainActivity.java

private void openDialogFragment(DialogFragment dialogStandardFragment) {
    if (dialogStandardFragment != null) {
        FragmentManager fm = getFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        DialogFragment prev = (DialogFragment) fm.findFragmentByTag("dialog");
        if (prev != null) {
            prev.dismiss();
        }/*from   w  w  w.  j a va 2s  . c o m*/
        try {
            dialogStandardFragment.show(ft, "dialog");
        } catch (IllegalStateException e) {
            Log.w(TAG, "activity wasn't yet made");
        }
    }
}

From source file:mtmo.test.mediadrm.MainActivity.java

private void onTaskFinished(final String message) {
    mLogger.d("Teardown after processing");

    mHandler.post(new Runnable() {
        @Override/*from  w  ww .java  2  s  . c o  m*/
        public void run() {
            DialogFragment fragment = (DialogFragment) getFragmentManager()
                    .findFragmentByTag(DIALOG_TASK_PROCESSING);
            if (fragment != null) {
                fragment.dismiss();
            }

            Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG).show();
            mTaskRunner = null;
        }
    });

}

From source file:it.scoppelletti.mobilepower.app.AbstractActivity.java

/**
 * Ripristina lo stato dell&rsquo;istanza.
 * // ww w  . jav a 2  s  .  c om
 * @param savedInstanceState Stato dell&rsquo;istanza.
 */
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    Fragment fragment;
    DialogFragment dlg;
    FragmentManager fragmentMgr;

    super.onRestoreInstanceState(savedInstanceState);

    fragmentMgr = getSupportFragmentManager();
    for (String tag : myDialogSet) {
        fragment = fragmentMgr.findFragmentByTag(tag);
        if (fragment == null) {
            myLogger.trace("Fragment {} not found.", tag);
            continue;
        }
        if (!(fragment instanceof DialogFragment)) {
            myLogger.warn("Fragment {} is not dialog.", tag);
            continue;
        }

        dlg = (DialogFragment) fragment;
        dlg.dismiss();
    }
}

From source file:com.android.mail.ui.AbstractActivityController.java

@Override
public void onRestart() {
    final DialogFragment fragment = (DialogFragment) mFragmentManager
            .findFragmentByTag(SYNC_ERROR_DIALOG_FRAGMENT_TAG);
    if (fragment != null) {
        fragment.dismiss();
    }//  w  w w. java 2 s. com
    // When the user places the app in the background by pressing "home",
    // dismiss the toast bar. However, since there is no way to determine if
    // home was pressed, just dismiss any existing toast bar when restarting
    // the app.
    if (mToastBar != null) {
        mToastBar.hide(false, false /* actionClicked */);
    }
}