Code example for TabWidget

Methods: getDescendantFocusabilitysetDescendantFocusability

0
		 // also takes care of putting focus on it when not in touch mode. 
		 // The jerk. 
		 // This hack tries to prevent this from pulling focus out of our 
		 // ViewPager. 
		 TabWidget widget = mTabHost.getTabWidget();
		 int oldFocusability = widget.getDescendantFocusability();
		 widget.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
		 mTabHost.setCurrentTab(position);
		 widget.setDescendantFocusability(oldFocusability);
	 } 
 
	 private int mState;
	 private int mPrevState;
 
	 @Override 
	 public void onPageScrollStateChanged(int state) {
		 mPrevState = mState;
		 mState = state;
	 } 
}