android 4.0 Dialog gets canceled when touched outside of dialog window

Check this method from the Android Developers site for dialog.

Try using the

dialog.setCanceledOnTouchOutside (boolean cancel)

Pass a boolean value to enable/disable dialog behaviour when touched outside of the dialog window.

Also go through these links:

How do I fire an event when click occurs outside a dialog

How to cancel an Dialog themed like Activity when touched outside the window?

I hope this answers your question.

Leave a Comment