title: How to make particular tab in FragmentTabHost has multiple fragment navigations like tabgroupactivity
body: <p>I created three tabs using FragmentTabHost. Now I need to make all the navigation are under the tabs. How can I get this. I need to get what we get using TabGroupActivity.</p>
  
  <p>Tab1
     --->frag1-->frag2</p>
  
  <p>Tab2
     --->frag3</p>
  
  <p>Tab3
     --->frag4--->frag5</p>
  
  <p>I have used fragmentTransaction.add(), fragmentTransaction.remove(), fragmentTransaction.replace(). These three methods but nothing give solution. </p>
  
  <p><strong>Replace</strong>  method shows new fragment view on top of existing fragment view.</p>
  
  <p><strong>Remove</strong> and <strong>Add</strong>, from these two remove only works, add does not works. </p>
  
  <p>Thanks in advance.</p>
  
  <p>TabHostMain.java</p>
  
  <pre><code>    @Override
      protected void onCreate(Bundle savedInstanceState)
   {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.bottom_tabs);
  
  mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
                  mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);
              View view;
      view=getTabView(R.drawable.ic_launcher);
  
      Bundle b = new Bundle();
      b.putString("key", "Simple");
      mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator(view),Fragment1.class, null);
  
      b = new Bundle();
      b.putString("key", "Contacts");
      view=getTabView(R.drawable.ic_launcher);
      mTabHost.addTab(mTabHost.newTabSpec("contacts").setIndicator(view), Fragment2.class, null);
  
      b = new Bundle();
      b.putString("key", "Custom");
      view=getTabView(R.drawable.ic_launcher);
      mTabHost.addTab(mTabHost.newTabSpec("custom").setIndicator(view),Fragment3.class, null);
  
  }
  </code></pre>
  
  <p>Fragment3.java</p>
  
  <pre><code>@Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
  
          View view=LayoutInflater.from(getActivity()).inflate(R.layout.activity_second, null);
  
          ((TextView)view.findViewById(R.id.second_act_text)).setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  FragmentManager fm=getChildFragmentManager();
                  FragmentTransaction fragmentTransaction=fm.beginTransaction();
                  fragmentTransaction.replace(R.id.second_activity, new Fragment1()).addToBackStack(null).commit();
              }
          });
          return view;
      }
  </code></pre>