当前位置: 首页>>代码示例>>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;未经允许,请勿转载。