title: DialogFragment not seen as visible when created with onCreateDialog
body: <p>(Using the compatibility library)</p>
  
  <p>I have implemented a dialog with extends DialogFragment.
  I create the dialog using AlertDialog.Builder in onCreateDialog (onCreateView is not used).</p>
  
  <p>In my fragment I invoke the dialog with:</p>
  
  <pre><code>dlg.show(getFragmentManager(), tag);
  </code></pre>
  
  <p>However, when I come to check visiblity, once the dialog is clearly visible, using</p>
  
  <pre><code>dlg.isVisible();
  </code></pre>
  
  <p>This returns false.</p>
  
  <p>Now the following is the Fragment::isVisible code from the compatibility sources.</p>
  
  <pre><code>final public boolean isVisible() {
      return isAdded() &amp;&amp; !isHidden() &amp;&amp; mView != null
              &amp;&amp; mView.getWindowToken() != null &amp;&amp; mView.getVisibility() == View.VISIBLE;
  }
  </code></pre>
  
  <p>The calls returns false because mView is null because the view isn't attached to a window. </p>
  
  <p>Any ideas as to how I should be invoking the dialog, or creating it for that matter, so that it is attached to the fragment's root view? Or how else I should be checking for visibility?</p>
  
  <p>Thanks in advance, Peter.</p>