title: Converting Dialog into DialogFragments
body: <p>I have a very nice dialog that does what I need.  But I need to update it to the new standards.</p>
  
  <p>this is my current dialog:</p>
  
  <pre><code>public class MyProgressDialog extends Dialog {
  
      private MyProgressDialog dialog;
  
      public MyProgressDialog(Context context) {
          super(context);
      }
  
      public MyProgressDialog show(Context context) {
          dialog = new MyProgressDialog(context);
          dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
          dialog.setContentView(R.layout.progress);
          dialog.getWindow().setBackgroundDrawableResource(
                  android.R.color.transparent);
          dialog.setCanceledOnTouchOutside(false);
          dialog.show();
          return dialog;
      }
  
      public void dismiss(Context context) {
  
          dialog.dismiss();
  
      }
  
  }
  </code></pre>
  
  <p>I use this NON-Fragment Dialog already with Fragments and ListFragments (using support library 4) as ProgressDialogs.  Unfortunately, on pages with Multiple fragments, they just stack on top of each other.  So I want to associate each dialog with each fragment.</p>
  
  <p>I call the dialog this way in the <code>onPreExecute()</code> of each of my <code>Task</code>'s:</p>
  
  <pre><code>dialog = new MyProgressDialog(getActivity());
  </code></pre>
  
  <p>Is it possible to tweak my current setup to work as I need, or do I need to completely redo this from the ground up?  I've looked at all the samples from Google and I can't find much that even look close to what I am doing.  Can I have some guidance n this transition?  Whether it is links, code samples, or ideas to research?</p>
  
  <p><strong>EDIT in response to comment below:</strong></p>
  
  <pre><code>@Override
  public Fragment getItem(int position) {
      Fragment f = null;
      switch (position) {
      case 0: {
          f = new RateFragment();
          Bundle args = new Bundle();
          f.setArguments(args);
          break;
      }
      case 1: {
          f = new ReviewFragment();
          Bundle args = new Bundle();
  
          f.setArguments(args);
          break;
      }
      default:
          throw new IllegalArgumentException("not this many fragments: "
                  + position);
      }
  
      return f;
  
  }
  </code></pre>
  
  <p>Tablet Layout for this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/frags"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal" &gt;
  
      &lt;fragment
          android:id="@+id/cat_frag"
          android:layout_width="450dp"
          android:layout_height="match_parent"
          class="com.---.---.RateFragmentActivity$RateFragment" /&gt;
  
      &lt;LinearLayout
          android:layout_width="4dp"
          android:layout_height="match_parent"
          android:background="#222" /&gt;
  
      &lt;fragment
          android:id="@+id/featured_frag"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          class="com.---.---.RateFragmentActivity$ReviewFragment" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>