title: How to create an Android Tabbed Dialog containing fragments?
body: <p>Can anyone point me to an example or show me how to create a simple <code>Tabbed Dialog</code> in Android where the contents of each tab are <code>Fragments</code>?  All the examples/tutorials I have found are about Fragments and Tabs, but nothing specific to <code>DialogFragments</code>.</p>
  
  <p>The documentation for <code>FragmentTabHost</code> shows how to create tabs within normal fragments using <code>getChildFragmentManager()</code>.  I'm assuming this should also work when the fragment is a <code>DialogFragment</code> but when I try it I get:</p>
  
  <pre><code>java.lang.IllegalStateException: Fragment does not have a view at android.support.v4.app.Fragment$1.findViewById(Fragment.java:1425)
  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:901)
  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
  ...
  </code></pre>
  
  <p>Here's my code for setting up the view (which is then passed to <code>AlertDialog.setView()</code>):</p>
  
  <pre><code>private void setupView(View v) {
      mTabHost = (FragmentTabHost) v.findViewById(android.R.id.tabhost);
  
     mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);
  
     mTabHost.addTab(mTabHost.newTabSpec("tab1").setIndicator("Tab1"),
              MyDialogFragment.class, null);
  }
  </code></pre>