title: Changing an activities content view based on actionbar tabs
body: <p>I am wondering if this can be done. Basically I have a layout with 2 fragments in it that I use for most of my tabs but on 2 of the tabs I want to add a couple more fragments to display more things. Is it possible to change the content view to a different layout when changing tabs?</p>
  
  <p>If that cant be done I thought about creating a layout with all the fragment parts that I would need and just changing the layouts of the fragments so the ones I dont use wont "show". I dont mean using <code>FragmentTransaction.hide()</code> because I want the fragments to fill the screen when others are not used. Would that be a bad idea or is there an easier way to do what I want?</p>
  
  <p>here is my code for the activity and tabs</p>
  
  <pre><code>public class Tabs extends Activity{
  long deleteID;
  
  @Override
  public void onCreate(Bundle create){
      super.onCreate(create);
  
      setContentView(R.layout.main_layout);
  
      createTabs();
      ActionBar bar = getActionBar();
      bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
      bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);
      bar.setDisplayHomeAsUpEnabled(true);
  
      if(create != null){
          bar.setSelectedNavigationItem(create.getInt("Home",0));
      }
  
  }
  </code></pre>
  
  <p>I also add tabs a whatnot but thats not important</p>
  
  <p>this is the actionbar subclass</p>
  
  <pre><code>private class TabListener implements ActionBar.TabListener{
      TabContent mFragment;
  
      public TabListener(TabContent fragment) {
          mFragment = fragment;
      }
  
      @Override
      public void onTabReselected(Tab tab, android.app.FragmentTransaction ft) {
  
      }
  
      @Override
      public void onTabSelected(Tab tab, android.app.FragmentTransaction ft) {
  
              ListFragment newListFragment = new BowlersListFragment();
              Fragment newFragment = new BowlerEntryFrag();
              ft = getFragmentManager().beginTransaction();
              ft.replace(R.id.frameOne, newListFragment);
              ft.replace(R.id.frameTwo, newFragment);
  
          ft.addToBackStack(null);
          ft.commit();
      }
  
      @Override
      public void onTabUnselected(Tab tab, android.app.FragmentTransaction ft) {
  
          if(ft != null){
              ft.remove(mFragment);
          }
      }
  
  }
  
  }
  </code></pre>
  
  <p>I tried doing <code>Activity.setContentView(r.layout.newView)</code> but that won't work</p>