title: AlertDialog setOnDismissListener not working
body: <p>My activity opens a dialog. When it closes I need the function <code>ReloadTable()</code> to be executed. So I am trying to use <code>setOnDismissListener</code> but its not getting triggered. Could someone please help what I am doing wrong?</p>
  
  <p>Thanks!</p>
  
  <pre><code>AlertDialog.Builder builder;
  AlertDialog alertDialog;
  Context mContext = getApplicationContext();
  LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
  View layout = inflater.inflate(R.layout.transaction, null);
  builder = new AlertDialog.Builder(new ContextThemeWrapper(TransactionsList.this , R.style.dialogwithoutdim));
  builder.setView(layout);
  alertDialog = builder.create();
  alertDialog.setOnDismissListener(new OnDismissListener() {
      public void onDismiss(final DialogInterface dialog) {
          ReloadTable();
      }
  });
  
  builder.show();
  </code></pre>