Example usage for android.app DialogFragment isAdded

List of usage examples for android.app DialogFragment isAdded

Introduction

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

Prototype

final public boolean isAdded() 

Source Link

Document

Return true if the fragment is currently added to its activity.

Usage

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

private void showLoadingProgress() {
    MtkLog.d(TAG, "<showLoadingProgress>");
    DialogFragment fragment;
    if (mLoadingProgressDialog != null) {
        fragment = mLoadingProgressDialog.get();
        if (fragment != null) {
            if (!fragment.isAdded()) {
                fragment.show(getFragmentManager(), null);
            }//from  w  w  w.  java  2s .  co m
            return;
        }
    }

    final DialogFragment genProgressDialog = new ProgressFragment(" ");
    genProgressDialog.setCancelable(false);
    genProgressDialog.show(getFragmentManager(), null);
    genProgressDialog.setStyle(R.style.RefocusDialog, genProgressDialog.getTheme());
    mLoadingProgressDialog = new WeakReference<DialogFragment>(genProgressDialog);
}

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

private void showSavingProgress(String albumName) {
    DialogFragment fragment;

    if (mSavingProgressDialog != null) {
        fragment = mSavingProgressDialog.get();
        if (fragment != null) {
            if (!fragment.isAdded()) {
                fragment.show(getFragmentManager(), null);
            }//  w  ww . j  a  v a 2s  .c  om
            return;
        }
    }
    String progressText;
    if (albumName == null) {
        progressText = getString(R.string.saving_image);
    } else {
        progressText = getString(R.string.m_refocus_saving_image, albumName);
    }
    final DialogFragment genProgressDialog = new ProgressFragment(progressText);
    genProgressDialog.setCancelable(false);
    genProgressDialog.show(getFragmentManager(), null);
    genProgressDialog.setStyle(R.style.RefocusDialog, genProgressDialog.getTheme());
    mSavingProgressDialog = new WeakReference<DialogFragment>(genProgressDialog);
}