sweet-alert-dialog icon indicating copy to clipboard operation
sweet-alert-dialog copied to clipboard

Showing again dialog issue

Open Vasu7052 opened this issue 7 years ago • 2 comments

I am using this dialog in my android app and i am creating its object only once and calling it again and again ifNotShowing . First time it appears perfectly but when second time i do pDialog.show() then only a translucent black screen appears nothing else.

Vasu7052 avatar Jan 01 '18 07:01 Vasu7052

Just in case you still need help here or any other person who does, i managed to get around this by binding a **setConfirmClickListener** to the ok button on the alert dialog, by doing this you will be able to call the alert again and again

      errorAlert.setTitleText("Check!");
               errorAlert.setContentText("Error in connection check your  internet connection!");
               //errorAlert.setConfirmText("Ok"); you can either set this (but its not necessary 
               errorAlert.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                   @Override
                   public void onClick(SweetAlertDialog sweetAlertDialog) {

                       //Dismiss your alert here then you will be able to call it again
                       sweetAlertDialog.dismiss();
                   }
               });
               errorAlert.show();

Hope this helps

DerrickBukenya avatar Feb 10 '18 19:02 DerrickBukenya

Thanx i will try that out!!

Vasu7052 avatar Jun 30 '18 14:06 Vasu7052