title: start Activity from an other Activity with Tabs
body: <p>I got an app with 3 tabs. Every tab has an activity and there is one activity two manage the tabs. This works fine and I can switch from tab to tab. But now i want to switch to a tab by pressing a Button on an other tab. I tried to start the activity like this:</p>
  
  <p><code>final Intent openTabMainActivity = new Intent(this,TabMainActivity.class);
  startActivity(openTabMainActivity);</code></p>
  
  <p>This starts the Activity infront of the tabs. But I only want to switch to the activity.</p>
  
  <p>This is the activity to manage the tabs (I am new at Android and I got this code from a tutorial):</p>
  
  <pre><code>public class MainActivity extends TabActivity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      TabHost tabHost = getTabHost();
  
      // Tab for Main
      TabSpec mainspec = tabHost.newTabSpec("Main");
      // setting Title and Icon for the Tab
      mainspec.setIndicator("Main", getResources().getDrawable(R.drawable.icon_main_tab));
      Intent mainIntent = new Intent(this, TabMainActivity.class);
      mainspec.setContent(mainIntent);
  
      // Tab for Graph
      TabSpec graphspec = tabHost.newTabSpec("Graph");
      graphspec.setIndicator("Graph", getResources().getDrawable(R.drawable.icon_graph_tab));
      Intent graphIntent = new Intent(this, TabGraphActivity.class);
      graphspec.setContent(graphIntent);
  
      // Tab for Option
      TabSpec optionspec = tabHost.newTabSpec("Option");
      optionspec.setIndicator("Option", getResources().getDrawable(R.drawable.icon_option_tab));
      Intent optionIntent = new Intent(this, TabOptionActivity.class);
      optionspec.setContent(optionIntent);
  
  
      // Adding all TabSpec to TabHost
      tabHost.addTab(mainspec); 
      tabHost.addTab(graphspec); 
      tabHost.addTab(optionspec); 
  }
  </code></pre>
  
  <p>}</p>