Code example for ViewPager.SimpleOnPageChangeListener

0
import com.viewpagerindicator.TitlePageIndicator; 
 
public class MultiListUi extends FragmentActivity { 
	 
	//class to cache the currently-shown page of the ViewPager 
	private static class CurrentPageListener extends SimpleOnPageChangeListener { 
		public static String CURRENT_PAGE = "com.creationline.cloudstack.ui.CurrentPageListener.CURRENT_PAGE";
		private static int currentPage;
		 
		public static int getCurrentPage() { 
			return currentPage;
		} 
 
		public void onPageSelected(int page) {
			currentPage = page;
		} 
	} 
	 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) {