title: FragmentTabHost doesn't show tab content
body: <p>I have an application witch contains a drawer menu for navigation and a fragment activity in which a fragment is shown depending on the drawer selection. Now I have 2 fragments, a simple one (SettingsFragment) and one containing a FragmentTabHost (SearchFragment). The with the FragmentTabHost is displayed when the application is opened. The problem is that if I switch between fragments - go to the Settings Fragment then back to SearchFragment then the tabhost's content is not displayed anymore (the onCreateView of the fragment contained in the first tab is not called) unless I switch between tabs.</p>
  
  <p>So I change between fragments using replace in my activity:</p>
  
  <pre><code>public void replaceRightFragment(int fragmentId) {
          Fragment newFragment = null;
          switch (fragmentId) {
              case FRAGMENT_SEARCH_PROPERTY:
                  newFragment = getSupportFragmentManager().findFragmentByTag(SearchPropertyFragment.class.getSimpleName());
                  if (newFragment == null) {
                      newFragment = new SearchPropertyFragment();
                  }
                  break;
              case FRAGMENT_SETTINGS:
                  newFragment = getSupportFragmentManager().findFragmentByTag(SettingsFragment.class.getSimpleName());
                  if (newFragment == null) {
                      newFragment = new SettingsFragment();
                  }
                  break;
          }
  
          if (newFragment != null) {
              if (!newFragment.isVisible()) {
                  FragmentManager fragmentManager = getSupportFragmentManager();
                  FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
  
                  // Replace whatever is in the fragment_container view with this fragment,
                  // and add the transaction to the back stack
  
                  fragmentTransaction.replace(R.id.main_view, newFragment, newFragment.getClass().getSimpleName());
                  // fragmentTransaction.remove(mainFragment);
                  // fragmentTransaction.add(R.id.main_view, newFragment, newFragment.getClass().getSimpleName());
  
  //            fragmentTransaction.addToBackStack(null);
  
                  // Commit the transaction
                  fragmentTransaction.commitAllowingStateLoss();
              }
              hideSlideMenu();
              hideKeyboard();
          }
  
      }
  </code></pre>
  
  <p>My tabhost layout: </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
      &gt;
  
      &lt;include layout="@layout/header_bar"/&gt;
  
      &lt;android.support.v4.app.FragmentTabHost
          android:id="@android:id/tabhost"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical"&gt;
  
              &lt;TabWidget
                  android:id="@android:id/tabs"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_weight="0"
                  android:orientation="horizontal"
                  /&gt;
  
              &lt;FrameLayout
                  android:id="@android:id/tabcontent"
                  android:layout_width="0dp"
                  android:layout_height="0dp"
                  android:layout_weight="0"
                  /&gt;
  
              &lt;FrameLayout
                  android:id="@+id/realtabcontent"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:layout_weight="1"
                  /&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v4.app.FragmentTabHost&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>... and tabhost setup in fragment:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      View view = inflater.inflate(R.layout.fragment_search_property,
              container, false);
  
      mTabHost = (FragmentTabHost) view.findViewById(android.R.id.tabhost);
      mTabHost.setup(getActivity(),
              getActivity().getSupportFragmentManager(), R.id.realtabcontent);
  
      mTabHost.addTab(
              mTabHost.newTabSpec(SELL_FRAGMENT_TAG).setIndicator(
                      getString(R.string.search_property_sell_tab_title)),
              SearchPropertySellFragmentTab.class, null);
      mTabHost.addTab(
              mTabHost.newTabSpec(RENT_FRAGMENT_TAG).setIndicator(
                      getString(R.string.search_property_rent_tab_title)),
              SearchPropertyRentFragmentTab.class, null);
      mTabHost.addTab(
              mTabHost.newTabSpec(ADD_ADVERT_FRAGMENT_TAG).setIndicator(
                      getString(R.string.search_property_add_tab_title)),
              SearchPropertyAddAdvertFragmentTab.class, null);
  
      ImageButton mDrawerButton = (ImageButton) view.findViewById(R.id.drawer_button);
      mDrawerButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              ((DrawerMenuController) getActivity()).onDrawerButtonPressed();
  //          if (mDrawerLayout.isDrawerOpen(mDrawerList)) {
  //              mDrawerLayout.closeDrawer(mDrawerList);
  //          } else {
  //              mDrawerLayout.openDrawer(mDrawerList);
  //          }
          }
      });
      mTabHost.onTabChanged(SELL_FRAGMENT_TAG);
      mTabHost.setOnTabChangedListener(this);
  
      return view;
  }
  
  @Override
  public void onDestroyView() {
      super.onDestroyView();
      mTabHost.removeAllViews();
      mTabHost = null;
  }
  </code></pre>
  
  <p>Any hints?</p>