本文整理匯總了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();
}