fizo07 fizo07 - 1 year ago 200
Android Question

Android click event outside a dialog

I would like to know how to solve a problem I've got.
I have a Dialog which pops up in an activity. The Dialog doesn't cover the whole screen, so the buttons from the activity still show. I can easily close the dialog when there is a touch outside the dialog's bounds with


However what I want to do is fire an event if a click is outside the Dialog's bounds(e.g if someone touches a button on the main Activity, it should close the Dialog and fire that event at the same time)

Answer Source

It Works For me,,

        Window window = dialog.getWindow();

See this

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download