Code example for ViewPager

Methods: getAdapter, onRestoreInstanceState, setCurrentItem

0
	} 
 
	@Override 
	public void onRestoreInstanceState(Parcelable state) {
		if (!(state instanceof Bundle)) {
			super.onRestoreInstanceState(state);
			return; 
		} 
		 
		if (state != null) {
			Bundle b = (Bundle)state;
			super.onRestoreInstanceState(b.getParcelable(STATE_SUPER));
			if (getAdapter() != null) { 
				int item = ((TabViewPagerAdapter)getAdapter()).getFunctionalPage(b.getInt(STATE_POS));
				if (item >= 0)
					this.setCurrentItem(item);
			} 
		} 
	} 
	 
	/**