android 4.0 Dialog gets canceled when touched outside of dialog window

前端 未结 3 1507
感情败类
感情败类 2020-12-05 13:19

Hi I am facing the problem on ICS like dialog is dismissed when we click outside dialog window, due to which I am getting problem like

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 13:33

    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.

提交回复
热议问题