Skip to content Skip to sidebar Skip to footer

Android - How An Alertdialog Injected With Spinner Can Be Closed When Touched Outer View?

Basically what I want to do is closing Spinner's Dialog Box and the Customized Dialog I've created when clicked outside of those boxes. Anyone knows how to handle these? dialog.xml

Solution 1:

you just add this option in your dialog

myDialogBox.setCancelable(true);

Solution 2:

Did you try to call this method setCanceledOnTouchOutside(true).

myDialogBox.setCanceledOnTouchOutside(true);

Afaik It should work.

Post a Comment for "Android - How An Alertdialog Injected With Spinner Can Be Closed When Touched Outer View?"