Elad Benda Elad Benda - 1 year ago 112
Android Question

why is setOnShowListener never called?

Here is my code:

mDialog.setOnShowListener(new OnShowListener() {
public void onShow(DialogInterface dialog) {
//some code

The breakpoints shows that
//some code
is never called. Can you help me understand what is happening ?

It's API 8 and above (supported by my app)

Answer Source

I could be wrong but you should set the listener before you call show() on the Dialog.

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