@Override public Fragment getItem(int i) { if (tabsDisabled) { return savedFragment; } else { ActionBar.Tab tab = actionBar.getTabAt(i); TiUIActionBarTab tabView = (TiUIActionBarTab) tab.getTag(); if (tabView.fragment == null) { tabView.initializeFragment(); } return tabView.fragment; } }
@Override public void onTabSelected(Tab tab, FragmentTransaction ft) { TiUIActionBarTab tabView = (TiUIActionBarTab) tab.getTag(); if (tabView.fragment == null) { // If not we will create it here then attach it // to the tab group activity inside the "content" container. tabView.initializeFragment(); } tabGroupViewPager.setCurrentItem(tab.getPosition()); TabProxy tabProxy = (TabProxy) tabView.getProxy(); ((TabGroupProxy) proxy).onTabSelected(tabProxy); if (tabClicked) { tabProxy.fireEvent(TiC.EVENT_CLICK, null); } else { tabClicked = true; } tabProxy.fireEvent(TiC.EVENT_SELECTED, null, false); }