Implementation method of alertdialog clicking the button does not disappear
I have a text input dialog box. When I click the "yes" button on the dialog box, it will verify the input and close the dialog box.
However, if the input is wrong, I want to stay in the same dialog box.
Every time, no matter what the input is, the dialog box should close automatically when I click the "no" button. How can I disable this? I found a lot on the Internet. Most of them are to modify the layout, add or cancel the confirmation, which is not ideal.
Now there's a good plan. Record it first:
The complete Java code is as follows:
Dialog layout:
The above is the implementation method of alertdialog that Xiaobian introduced to you. I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!