本文整理汇总了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);
}
}
示例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);
}
}
示例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();
}
示例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"));
}
示例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();
}
}
示例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;
}
示例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();
}
示例8: createDownloadFailureDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void createDownloadFailureDialog(DialogFragment d) {
d.dismiss();
DialogFragment uploadFailureDialog = new DownloadConnectionFailureDialog();
uploadFailureDialog.show(getSupportFragmentManager(), "UploadFailure");
}
示例9: createNameFailureDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void createNameFailureDialog(DialogFragment d) {
d.dismiss();
DialogFragment nameFailureDialog = new DownloadNameFailureDialog();
nameFailureDialog.show(getSupportFragmentManager(), "NameFailure");
}
示例10: storeVersionAndDismiss
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
private void storeVersionAndDismiss(DialogFragment fragment, RateMyAppConfig config) {
storeVersion(fragment.getContext(), config.getAppVersion());
fragment.dismiss();
}
示例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();
}