I have a few little custom dialogs in my app, and they are kinda small. I've noticed that the user touches the area around the dialog to try to dismiss it (similar to interaction on a website). I was wondering if there are any built in methods for doing this that I must have missed in the doc, or if there are any tutorials out there on how to approach implementing this?

I don't think I'm explaining this well, so if anyone doesn't understand what I'm talking about I will try to provide more information.

Thanks in advance.

EDIT

Found the answer in a question linked by Balaji:

dialog.setCanceledOnTouchOutside(true);
有帮助吗?

解决方案

Found the answer in a question linked by Balaji:

dialog.setCanceledOnTouchOutside(true);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top