Buggy code:
public class HomeActivity extends FragmentActivity implements ViewPager . OnPageChangeListener , TabHost . OnTabChangeListener { private TabHost mTabHost ; private ViewPager mViewPager ; private PagerAdapter mPagerAdapter ; public static Bundle extras ; private SharedPreferences shared ; private int position = 0 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_home ) ; List < Fragment > fragments = new Vector < Fragment > ( ) ; fragments . add ( Fragment . instantiate ( this , tab_home . class . getName ( ) ) ) ; fragments . add ( Fragment . instantiate ( this , tab_search . class . getName ( ) ) ) ; fragments . add ( Fragment . instantiate ( this , tab_request . class . getName ( ) ) ) ; fragments . add ( Fragment . instantiate ( this , tab_setting . class . getName ( ) ) ) ; this . mPagerAdapter = new PagerAdapter ( super . getSupportFragmentManager ( ) , fragments ) ; this . mViewPager = ( ( ViewPager ) ( super . findViewById ( viewpager ) ) ) ; this . mViewPager . setAdapter ( this . mPagerAdapter ) ; this . mViewPager . setOnPageChangeListener ( this ) ; mTabHost = ( ( TabHost ) ( findViewById ( tabhost ) ) ) ; mTabHost . setup ( ) ; AddTab ( this . mTabHost , this . mTabHost . newTabSpec ( "Tab1" ) . setIndicator ( "" , getResources ( ) . getDrawable ( ic_action_person ) ) ) ; AddTab ( this . mTabHost , this . mTabHost . newTabSpec ( "Tab2" ) . setIndicator ( "" , getResources ( ) . getDrawable ( ic_action_search ) ) ) ; AddTab ( this . mTabHost , this . mTabHost . newTabSpec ( "Tab3" ) . setIndicator ( "" , getResources ( ) . getDrawable ( ic_action_group ) ) ) ; <START_BUG> AddTab ( this . mTabHost , this . mTabHost . newTabSpec ( "Tab4" ) . setIndicator ( "" , getResources ( ) . getDrawable ( ic_action_settings ) ) ) ; <END_BUG> mTabHost . setOnTabChangedListener ( this ) ; HomeActivity . extras = getIntent ( ) . getExtras ( ) ; shared = getSharedPreferences ( "social" , MODE_PRIVATE ) ; position = shared . getInt ( "pos" , 0 ) ; mTabHost . setCurrentTab ( position ) ; mViewPager . setCurrentItem ( position ) ; if ( HomeActivity . extras . getString ( "service" ) . equals ( "sendrequest" ) ) { Toast . makeText ( getApplication ( ) , "Request<seq2seq4repair_space>send<seq2seq4repair_space>Successfully" , LENGTH_LONG ) . show ( ) ; } if ( HomeActivity . extras . getString ( "service" ) . equals ( "acceptrequest" ) ) { Toast . makeText ( getApplication ( ) , "Request<seq2seq4repair_space>accepted<seq2seq4repair_space>Successfully" , LENGTH_LONG ) . show ( ) ; } } private void AddTab ( TabHost tabHost , TabHost . TabSpec tabSpec ) { } public void onTabChanged ( String tag ) { } @ Override public void onPageScrollStateChanged ( int arg0 ) { } @ Override public void onPageScrolled ( int arg0 , float arg1 , int arg2 ) { } @ Override public void onPageSelected ( int arg0 ) { } class TabFactory implements TabContentFactory { private final Context mContext ; public TabFactory ( Context context ) { } public View createTabContent ( String tag ) { } } }

Fix:
AddTab ( this . mTabHost , this . mTabHost . newTabSpec ( "Tab4" ) . setIndicator ( "" , getResources ( ) . getDrawable ( ic_action_about ) ) ) ;