title: If Tabs and Activities don't go together..Is there a way to cheat?
body: <p>I am having a real hard time on putting my activities in tabs. I have an activity that parses an XML file and puts them on a list, and it works perfectly on its own. When I call it on a tab however it does not work (i get the dreaded "Sorry! blah blah.. has stopped unexpectedly" prompt... BTW yes I did the manifest). </p>
  
  <p>I have migrated the activities to work as one activity, voila! it worked!!! However this is not the way we wanted to go with this project - WE REALLY NEED to have separate activities.</p>
  
  <p>So as many people had found out that tabs and activities doesn't work well together is there a way to work around it? Some sort of emulsifier maybe?  </p>
  
  <p>Here is the code:</p>
  
  <p>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.widget.TabHost;
  import android.widget.Toast;</p>
  
  <p>public class TabDemo extends Activity{</p>
  
  <pre><code>/** data members go here*/
  
  public void onCreate(Bundle icicle) {
      super.onCreate(icicle);
      setContentView(R.layout.main);
  
      try {
          TabHost tabs= (TabHost)findViewById(R.id.tabhost);
  
          tabs.setup();
          Intent callResultHits = new Intent(this, my.tabebd.layout.ResultHits.class);
  
          TabHost.TabSpec spec = tabs.newTabSpec("tag1");
          spec.setContent(callResultHits);
          spec.setIndicator("Result",   getResources().getDrawable(R.drawable.ic_tab_search_result) );
          tabs.addTab(spec);
  
          spec = tabs.newTabSpec("tag2");
          spec.setContent(R.id.tab2);
          spec.setIndicator("Details",getResources().
                               getDrawable(R.drawable.ic_tab_details));
          tabs.addTab(spec);
  
          tabs.setCurrentTabByTag("tag1");
      } catch (Throwable t) {
          // TODO Auto-generated catch block
          Toast.makeText(this, "Exception: " + t.toString(), 50000).show();
      }
  }
  </code></pre>
  
  <p>here is one of the activities...</p>
  
  <pre><code>public class ResultHits extends Activity implements OnItemClickListener {
  ListView listView_titles;
  ArrayList&lt;String&gt; items = new ArrayList&lt;String&gt;();
  String [] test = {"1", "2","3"};
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
  
  
  
      listView_titles = (ListView)findViewById(R.id.list);
  
      listView_titles.setAdapter(new ArrayAdapter&lt;String&gt;
      (this,R.layout.row, R.id.row_text,test));
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I omitted the xml parsing part... if this basic list can be shown inside the tab then it will be perfect. TY in advance</p>
  
  <p>BTW setcurrenttabByTag was previously setCurrenttab(2)..actualy i did these values 0,1, 2, 3 just in case  ;)</p>