AlertDialog buttons always close the dialog after clicking

I use AlertDialog with two buttons (one positive, one negative). I installed a handler for those buttons that do not mention dismissal. Indeed, after clicking, I do not want the dialog to close. However, it seems that as soon as we click on the positive / negative button on AlertDialog, it always closes.

Is there a way to prevent the dialog from closing after clicking any button?

Thank,

Vincent

+3
source share
3 answers

Use a custom layout for dialogue and you will be happy!

+5
source

Use a custom dialog, not an AlertDialog.

+1

<activity android:name="MyDialogActivity" android:theme="@android:style/Theme.Dialog" />
0

Source: https://habr.com/ru/post/1789310/


All Articles