Code example for TabHost

Methods: setOnTabChangedListenersetup

0
 
        mContentId = contentId;
        mOnTabChangeListener = listener;
 
        mTabHost = (TabHost) findViewById(android.R.id.tabhost);
        mTabHost.setup();
 
        mMapTabInfo = new HashMap<String, TabInfo>();
 
        mTabHost.setOnTabChangedListener(this);
 
    } 
 
    /** 
     * Add tab. 
     * @param tag tag 
     * @param indicator String indicator 
     * @param fragmentClass first view of Fragment 
     */ 
    protected void addTab(String tag, String indicator, Class<? extends Fragment> fragmentClass) {
        addTab(tag, null, indicator, fragmentClass, new Bundle());