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