Java Code Examples for android.support.v7.app.AppCompatDialog#dismiss()

The following examples show how to use android.support.v7.app.AppCompatDialog#dismiss() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DialogUIUtils.java    From KUtils with Apache License 2.0 6 votes vote down vote up
/**
 * 关闭弹出框
 */
public static void dismiss(DialogInterface... dialogs) {
    if (dialogs != null && dialogs.length > 0) {
        for (DialogInterface dialog : dialogs) {
            if (dialog instanceof Dialog) {
                Dialog dialog1 = (Dialog) dialog;
                if (dialog1.isShowing()) {
                    dialog1.dismiss();
                }
            } else if (dialog instanceof AppCompatDialog) {
                AppCompatDialog dialog2 = (AppCompatDialog) dialog;
                if (dialog2.isShowing()) {
                    dialog2.dismiss();
                }
            }
        }

    }


}
 
Example 2
Source File: DialogUIUtils.java    From KUtils-master with Apache License 2.0 6 votes vote down vote up
/**
 * 关闭弹出框
 */
public static void dismiss(DialogInterface... dialogs) {
    if (dialogs != null && dialogs.length > 0) {
        for (DialogInterface dialog : dialogs) {
            if (dialog instanceof Dialog) {
                Dialog dialog1 = (Dialog) dialog;
                if (dialog1.isShowing()) {
                    dialog1.dismiss();
                }
            } else if (dialog instanceof AppCompatDialog) {
                AppCompatDialog dialog2 = (AppCompatDialog) dialog;
                if (dialog2.isShowing()) {
                    dialog2.dismiss();
                }
            }
        }

    }


}
 
Example 3
Source File: StytledDialog.java    From DialogUtils with Apache License 2.0 4 votes vote down vote up
public static void dismiss(AppCompatDialog dialog){
    if (dialog != null && dialog.isShowing()){
        dialog.dismiss();
    }
}