當前位置: 首頁>>代碼示例>>Java>>正文


Java DialogFragment.dismiss方法代碼示例

本文整理匯總了Java中android.support.v4.app.DialogFragment.dismiss方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogFragment.dismiss方法的具體用法?Java DialogFragment.dismiss怎麽用?Java DialogFragment.dismiss使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.app.DialogFragment的用法示例。


在下文中一共展示了DialogFragment.dismiss方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onEventMainThread

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void onEventMainThread(ThrowableFailureEvent event) {
    if (!isInExecutionScope(executionScope, event)) {
        return;
    }
    checkLogException(event);
    // Execute pending commits before finding to avoid multiple error fragments being shown
    FragmentManager fm = getFragmentManager();
    fm.executePendingTransactions();

    DialogFragment existingFragment = (DialogFragment) fm.findFragmentByTag(TAG_ERROR_DIALOG);
    if (existingFragment != null) {
        // Just show the latest error
        existingFragment.dismiss();
    }

    android.support.v4.app.DialogFragment errorFragment = (android.support.v4.app.DialogFragment) factory
            .prepareErrorFragment(event, finishAfterDialog, argumentsForErrorDialog);
    if (errorFragment != null) {
        errorFragment.show(fm, TAG_ERROR_DIALOG);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:ErrorDialogManager.java

示例2: onEventMainThread

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void onEventMainThread(ThrowableFailureEvent event) {
    if (!isInExecutionScope(executionScope, event)) {
        return;
    }
    checkLogException(event);
    // Execute pending commits before finding to avoid multiple error fragments being shown
    FragmentManager fm = getFragmentManager();
    fm.executePendingTransactions();

    DialogFragment existingFragment = (DialogFragment) fm.findFragmentByTag(TAG_ERROR_DIALOG);
    if (existingFragment != null) {
        // Just show the latest error
        existingFragment.dismiss();
    }

    DialogFragment errorFragment = (DialogFragment) factory
            .prepareErrorFragment(event, finishAfterDialog, argumentsForErrorDialog);
    if (errorFragment != null) {
        errorFragment.show(fm, TAG_ERROR_DIALOG);
    }
}
 
開發者ID:devzwy,項目名稱:KUtils,代碼行數:22,代碼來源:ErrorDialogManager.java

示例3: onIconSelection

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Override
public void onIconSelection(DialogFragment dialog, String iconName, String iconType, int iconResId) {
    icon = iconName;
    iconText.setText(iconType);
    imageIconSelect.setImageResource(iconResId);
    dialog.dismiss();
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:8,代碼來源:CreateEditActivity.java

示例4: dontClearForDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
@Test
public void dontClearForDialog() throws Throwable {
    testFragment.testValue = new AutoClearedValue<>(testFragment, "foo");
    DialogFragment dialogFragment = new DialogFragment();
    dialogFragment.show(testFragment.getFragmentManager(), "dialog");
    dialogFragment.dismiss();
    InstrumentationRegistry.getInstrumentation().waitForIdleSync();
    assertThat(testFragment.testValue.get(), is("foo"));
}
 
開發者ID:googlesamples,項目名稱:android-architecture-components,代碼行數:10,代碼來源:AutoClearedValueTest.java

示例5: dismissDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void dismissDialog() {
    final FragmentManager fm = getFragmentManager();
    if (fm == null)
        return;
    Fragment prev = fm.findFragmentByTag("cadfragment");
    if (prev != null) {
        DialogFragment df = (DialogFragment) prev;
        df.dismiss();
    }
}
 
開發者ID:SalmanTKhan,項目名稱:MyAnimeViewer,代碼行數:11,代碼來源:AnimeMaterialListFragment.java

示例6: dismissDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
protected boolean dismissDialog() {
    boolean isVisible = false;
    Fragment prev = getSupportFragmentManager().findFragmentByTag(LoadingDialog.DIALOG_TAG);
    if (prev != null) {
        DialogFragment df = (DialogFragment) prev;
        df.dismiss();
        isVisible = true;
    }
    return isVisible;
}
 
開發者ID:CactusSoft,項目名稱:zabbkit-android,代碼行數:11,代碼來源:LoadingDialogActivity.java

示例7: hideDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void hideDialog() {
	DialogFragment dialogFragment = (DialogFragment) mFragmentManager.findFragmentByTag(TAG);
	if (dialogFragment == null) {
		throw new IllegalStateException("Dialog is not visible.");
	}

	dialogFragment.dismiss();
	mFragmentManager.executePendingTransactions();
}
 
開發者ID:aartikov,項目名稱:Alligator,代碼行數:10,代碼來源:DialogFragmentHelper.java

示例8: createDownloadFailureDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void createDownloadFailureDialog(DialogFragment d) {
    d.dismiss();
    DialogFragment uploadFailureDialog = new DownloadConnectionFailureDialog();
    uploadFailureDialog.show(getSupportFragmentManager(), "UploadFailure");
}
 
開發者ID:Davarco,項目名稱:Divertio,代碼行數:6,代碼來源:MainActivity.java

示例9: createNameFailureDialog

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
public void createNameFailureDialog(DialogFragment d) {
    d.dismiss();
    DialogFragment nameFailureDialog = new DownloadNameFailureDialog();
    nameFailureDialog.show(getSupportFragmentManager(), "NameFailure");
}
 
開發者ID:Davarco,項目名稱:Divertio,代碼行數:6,代碼來源:MainActivity.java

示例10: storeVersionAndDismiss

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
private void storeVersionAndDismiss(DialogFragment fragment, RateMyAppConfig config) {
    storeVersion(fragment.getContext(), config.getAppVersion());
    fragment.dismiss();
}
 
開發者ID:zendesk,項目名稱:rate_my_app_android,代碼行數:5,代碼來源:DialogActionListener.java

示例11: onStoreButtonClicked

import android.support.v4.app.DialogFragment; //導入方法依賴的package包/類
/**
 * This method is called when the "Yes, rate our app" button is clicked, before the version name
 * is stored and dialog is dismissed.
 *
 * By default, it uses the value of {@link RateMyAppConfig#getStoreUrl()} with a
 * {@link Intent#ACTION_VIEW} to launch the Google Play Store (or a browser).
 *
 * @param dialogFragment the {@link RateMyAppDialog} which was shown
 * @param config the {@link RateMyAppConfig} which was used to configure the dialog.
 */
protected void onStoreButtonClicked(DialogFragment dialogFragment, RateMyAppConfig config) {
    final Intent storeIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(config.getStoreUrl()));

    dialogFragment.getContext().startActivity(storeIntent);

    storeVersion(dialogFragment.getContext(), config.getAppVersion());
    dialogFragment.dismiss();
}
 
開發者ID:zendesk,項目名稱:rate_my_app_android,代碼行數:19,代碼來源:DialogActionListener.java


注:本文中的android.support.v4.app.DialogFragment.dismiss方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。