Code example for TabHost

Methods: setCurrentTabByTag

0
      mTabs.clear();
      mLastTab = null;
    } 
 
    public void setCurrentTabByTag(final String tag) {
      mTabHost.setCurrentTabByTag(tag);
    } 
 
    protected TabInfo getTabInfo(final String tabId) { return mTabs.get(tabId); }
    protected TabInfo getLastTabInfo() { return mLastTab; }
 
    @Override 
    public void onTabChanged(final String tabId) {
      final TabInfo newTab = mTabs.get(tabId);
      if (mLastTab != newTab) {
        final FragmentTransaction ft = mActivity.getSupportFragmentManager()
            .beginTransaction(); 
        if (mLastTab != null && mLastTab.fragment != null) {
          ft.detach(mLastTab.fragment);
        } 
        if (newTab != null) {