-1

I have a dialogfragment, which should dismiss, if i click outside of the dialog. I have no button or something else to close the dialog.

But before the dismiss is calling, I want to check a field in my dialog. If the check is positive, then the dialog should close, else not.

Which method can I override to do that? Or can I do it manual with a onTouchListener, which dismiss the dialog, if I'm clicking beside?

user3621165
  • 212
  • 4
  • 16

1 Answers1

-1

I would do following. I would add transparent button on background of your dialog fragment in order to fragment take all place and set onClickListener for that button. Maybe it's wierd but it's work ))

thealeksandr
  • 1,686
  • 12
  • 17