本文整理汇总了Java中android.app.DialogFragment.dismiss方法的典型用法代码示例。如果您正苦于以下问题:Java DialogFragment.dismiss方法的具体用法?Java DialogFragment.dismiss怎么用?Java DialogFragment.dismiss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.DialogFragment
的用法示例。
在下文中一共展示了DialogFragment.dismiss方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeDialog
import android.app.DialogFragment; //导入方法依赖的package包/类
private void removeDialog(int dialogId) {
FragmentManager fm = getFragmentManager();
if (fm == null || isRemoving() || isDetached()) {
return;
}
// Make sure the "show dialog" transaction has been processed when we call
// findFragmentByTag() below. Otherwise the fragment won't be found and the dialog will
// never be dismissed.
fm.executePendingTransactions();
DialogFragment fragment = (DialogFragment) fm.findFragmentByTag(getDialogTag(dialogId));
if (fragment != null) {
fragment.dismiss();
}
}
示例2: closeDialogIfOpen
import android.app.DialogFragment; //导入方法依赖的package包/类
private void closeDialogIfOpen(String tag) {
FragmentManager manager = getFragmentManager();
if (manager == null) {
// Do nothing if the manager doesn't exist yet; see http://crbug.com/480544.
return;
}
DialogFragment df = (DialogFragment) manager.findFragmentByTag(tag);
if (df != null) {
df.dismiss();
}
}
示例3: hideDonateDialog
import android.app.DialogFragment; //导入方法依赖的package包/类
void hideDonateDialog() {
DialogFragment fragment = (DialogFragment) getFragmentManager()
.findFragmentByTag(FRAGMENT_DONATION_PROGRESS);
if (fragment != null && !isStopped()) {
fragment.dismiss();
}
}
示例4: dismissDialog
import android.app.DialogFragment; //导入方法依赖的package包/类
private void dismissDialog(String tag, boolean allowStateLoss) {
DialogFragment fragment = (DialogFragment) getFragmentManager().findFragmentByTag(tag);
if (fragment != null) {
if (Log.isLoggable(UILog.TAG, Log.DEBUG)) {
UILog.d("dismiss " + tag + ", " + allowStateLoss + ": " + allowStateLoss
+ ", stopped: " + isStopped());
}
if (allowStateLoss) {
fragment.dismissAllowingStateLoss();
} else if (!isStopped()) {
fragment.dismiss();
}
}
}
示例5: onEventMainThread
import android.app.DialogFragment; //导入方法依赖的package包/类
public void onEventMainThread(ThrowableFailureEvent event) {
if (ErrorDialogManager.isInExecutionScope(this.executionScope, event)) {
ErrorDialogManager.checkLogException(event);
FragmentManager fm = getFragmentManager();
fm.executePendingTransactions();
DialogFragment existingFragment = (DialogFragment) fm.findFragmentByTag(ErrorDialogManager.TAG_ERROR_DIALOG);
if (existingFragment != null) {
existingFragment.dismiss();
}
DialogFragment errorFragment = (DialogFragment) ErrorDialogManager.factory.prepareErrorFragment(event, this.finishAfterDialog, this.argumentsForErrorDialog);
if (errorFragment != null) {
errorFragment.show(fm, ErrorDialogManager.TAG_ERROR_DIALOG);
}
}
}
示例6: dismissDialog
import android.app.DialogFragment; //导入方法依赖的package包/类
private void dismissDialog(String tag) {
DialogFragment fragment = (DialogFragment) getFragmentManager().findFragmentByTag(tag);
if (fragment != null && !isStopped()) {
fragment.dismiss();
}
}
示例7: dismissProgress
import android.app.DialogFragment; //导入方法依赖的package包/类
public static void dismissProgress(final FragmentManager fm) {
final DialogFragment fragment = (DialogFragment) fm.findFragmentByTag(FRAGMENT_TAG);
fragment.dismiss();
}