title: Android TabHost with only selected tab on stack
body: <p>I have a TabHost with 4 tabs. I need only the selected tab activity to be available on the stack. When user changes the tab, how to finish the activity under previous tab. I tried the following code. Here showing code for first tab. It similar for remaining tabs: </p>
  
  <pre><code>spec = tabHost.newTabSpec("tab1").setIndicator("Tab1", 
              res.getDrawable(R.drawable.ic_tab_tab1))
                      .setContent(new Intent(this, Tab1.class)
                      .addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_TOP));
  </code></pre>
  
  <p>But the above code is deleting the Tab1 Activity on stack/heap only when the user comes again to that tab but not when user changes to new tab.</p>