Code example for TabHost

Methods: setOnTabChangedListener

0
		{ 
			super(activity.getSupportFragmentManager());
			mContext = activity;
			mTabHost = tabHost;
			mViewPager = pager;
			mTabHost.setOnTabChangedListener(this);
			mViewPager.setAdapter(this);
			mViewPager.setOnPageChangeListener(this);
		} 
 
		public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args)
		{ 
			tabSpec.setContent(new DummyTabFactory(mContext));
			String tag = tabSpec.getTag();
 
			TabInfo info = new TabInfo(tag, clss, args);
			mTabs.add(info);
			mTabHost.addTab(tabSpec);
			notifyDataSetChanged(); 
		}