I have implemented custom dialog. But when I click to close dialog textfield is refreshed and when I tapped again it closes dialog. Why I need to press button twice to close dia