title: Dynamically add ListView to Tabs in TabHost
body: <p>I've been trying to dynamically add Tabs to a TabHost and add a ListView to each of those tabs. The problem is that I get the following error <strong><em>"Could not create tab content because could not find view with id XX"</em></strong>. The thing is that I am giving an ID to each new ListView and adding the view to the TabHost.</p>
  
  <pre><code>TabHost mTabHost = getTabHost();
  TabSpec tspec;
   for(int c = 0; c &lt; 4; c++){
  ListView lview = new ListView(this);
  lview.setId(c+5000);    
  mTabHost.addView(lview);
  lview.setAdapter(aa);
  tspec = mTabHost.newTabSpec("tab_test" + String.valueOf(c)).setIndicator("TAB "+ String.valueOf(c)).setContent(lview.getId());
      mTabHost.addTab(tspec);
  }
  </code></pre>
  
  <p>I also tried adding the new ListView to the TabWidget and the FrameLayout but the results are the same. Am I missing something ?</p>