sweet-alert-dialog
sweet-alert-dialog copied to clipboard
Showing again dialog issue
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.
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
Thanx i will try that out!!