AlertDialog Android Studio

1

My question is this:
Is there any way to make an AlertDialog always show (even if you tap outside the object or on the back button) until you click on the "accept" or "cancel" button?

    
asked by Pablo 23.01.2018 в 11:56
source

1 answer

9

To achieve that, you can use the following:

  

dialog.setCancelable(false); When pressing back, do not close your dialog. - The opposite happens for a true value

     

dialog.setCanceledOnTouchOutside(false); When you touch outside the dialog window, it does not close. - The opposite happens for a true value

    
answered by 23.01.2018 в 12:58