pedant / sweet-alert-dialog

SweetAlert for Android, a beautiful and clever alert dialog
http://pedant.github.io
7.26k stars 1.94k forks source link

Dismiss issue #140

Open leogiroux opened 7 years ago

leogiroux commented 7 years ago

The dialog is not properly dismissed sometimes. I still have the dialog background but not the dialog itself. It is very annoying if you have set the dialogs to setCancelable(false) cause you cant do anything after in your app.

Best regards

vuthaiduy1990 commented 7 years ago

I met the same thing. To solve, I override onClick function then call dismiss method directly

dialog.setCancelable(false);   
dialog.setCanceledOnTouchOutside(false);   
dialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {   
            @Override   
            public void onClick(SweetAlertDialog sweetAlertDialog) {   
                dialog.dismiss();   
            }  
        });
Krammig commented 9 months ago

I know this is a way old post, but I was just wondering if it has been fixed in the current version, or is it still suggested this approach is used ? Thanks