title: android: how do I check if dialogfragment is showing
body: <p>I launch my dialog fragment using</p>
  
  <pre><code>FragmentTransaction ft = 
  getFragmentManager().beginTransaction();
  MyDialogFragment dialog = new MyDialogFragment()
  dialog.show(ft, "dialog");
  </code></pre>
  
  <p>then to get a handle on it I do </p>
  
  <pre><code>Fragment prev = getFragmentManager().findFragmentByTag("dialog");
  </code></pre>
  
  <p>but once I get <code>prev</code>, how do I check if it is showing?</p>
  
  <p><strong>Back Story</strong></p>
  
  <p>My problem is that my looping code keeps launching the dialog again and again. But if the dialog is already showing, I don't want it to launch again.
  This back story is just for context. The answer I seek is not: "move it out of the loop."</p>