title: Android find out when a dialog is shown on the screen
body: <p>I need to find the coordinates of some elements of <a href="http://developer.android.com/intl/ru/reference/android/app/Dialog.html" rel="nofollow">dialog</a>.<br>
  But before the dialog is shown on the screen, all methods return 0.<br>
  How I can find out when dialog is shown on the screen?</p>
  
  <p>I mean that after <strong>dialog.show() dialog.isShowing()</strong> returns true, but </p>
  
  <pre><code>int width=mDialog.getWindow().getDecorView().getWidth();
  </code></pre>
  
  <p>returns 0</p>