Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaterialAlertDialogBuilder - prevent dismissing when positive, negative, or neutral button is click #3045

Open
ArcherEmiya05 opened this issue Oct 21, 2022 · 2 comments

Comments

@ArcherEmiya05
Copy link

Is there a way to prevent the auto dismissal of alert dialog when the buttons are clicked? Providing a method in the builder class would be really great.

@hunterstich
Copy link
Contributor

Hi @ArcherEmiya05,

There is a MaterialAlertDialogBuilder.setCancelable(boolean), which I think is exactly what you're looking for.

Let me know if this doesn't solve your issue and I will re-open.

@ArcherEmiya05
Copy link
Author

ArcherEmiya05 commented Nov 1, 2022

Hi @ArcherEmiya05,

There is a MaterialAlertDialogBuilder.setCancelable(boolean), which I think is exactly what you're looking for.

Let me know if this doesn't solve your issue and I will re-open.

Hello, yes there is setCancelable however even if you set it to false clicking the buttons will automatically dismiss the dialog. The dismissal of dialog when button is clicked is always guaranteed no matter if setCancelable is true or false. This is an old issue actually even from plain AlertDialog, I think MaterialAlertDialog should at least fixed that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants