@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { // When the given tab is selected, switch to the corresponding page in // the ViewPager. mViewPager.setCurrentItem(tab.getPosition()); Log.d(LOG_TAG, "OnPageChangeListener Called with position - " + tab.getPosition()); if (tab.getPosition() == 0) { Log.d(LOG_TAG, "Trying to find MySpotsFragment."); MySpotsFragment fragment = (MySpotsFragment) mSectionsPagerAdapter.getItem(tab.getPosition()); if (fragment != null) { Log.d(LOG_TAG, "Found MySpotsFragment. Calling refresh spot list."); fragment.RefreshListOfSpotsTwoLines(this); } } else if (tab.getPosition() == 1) { // AddSpotFragment fragment = (AddSpotFragment) // mSectionsPagerAdapter.getItem(tab.getPosition()); // if (fragment != null) { // Log.d(LOG_TAG, "Found MySpotsFragment. Calling refresh spot list."); // fragment.refreshSpotNamesInAutocomplete(this); // } } }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { // When the given tab is selected, switch to the corresponding page in // the ViewPager. Log.d(Constants.TAG, "MainActivity.onTabSelected"); mViewPager.setCurrentItem(tab.getPosition()); }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { // When the given tab is selected, switch to the corresponding page in // the ViewPager. mViewPager.setCurrentItem(tab.getPosition()); favTab.refreshListview(); }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { // When the given tab is selected, switch to the corresponding page in // the ViewPager. mViewPager.setCurrentItem(tab.getPosition()); mViewPager.setOffscreenPageLimit(5); // setta il limite per non ricaricare i fragments }
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { if (mViewPager.getCurrentItem() != tab.getPosition()) mViewPager.setCurrentItem(tab.getPosition()); if (getCommentFragment() != null) getCommentFragment().clearActionMode(); if (getRepostFragment() != null) getRepostFragment().clearActionMode(); switch (tab.getPosition()) { case 1: comment = true; break; case 2: repost = true; break; case 3: break; } }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { // When the given tab is selected, show the tab contents in the // container view. Fragment fragment = new DummySectionFragment(); Bundle args = new Bundle(); args.putInt(DummySectionFragment.ARG_SECTION_NUMBER, tab.getPosition() + 1); fragment.setArguments(args); getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit(); }
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) { switch (tab.getPosition()) { case 1: comment = false; break; case 2: repost = false; break; } }
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) { switch (tab.getPosition()) { case 1: if (comment) { Utility.stopListViewScrollingAndScrollToTop(getCommentFragment().getListView()); } break; case 2: if (repost) { Utility.stopListViewScrollingAndScrollToTop(getRepostFragment().getListView()); } break; case 3: break; } }
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { int tabIndex = tab.getPosition(); NetworkListFragment fragment = fragments.get(tabIndex); if (fragment == null) { if (tabIndex == 0) { fragment = new BackupedFragment(); } else if (tabIndex == 1) { fragment = new ConfiguredFragment(); } } fragments.put(tabIndex, fragment); getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit(); }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { Fragment fragment = new MyFragment(); Bundle args = new Bundle(); switch (tab.getPosition()) { case 0: args.putString("color", "#2574a9"); fragment.setArguments(args); break; case 1: args.putString("color", "#36d5b5"); fragment.setArguments(args); break; case 2: args.putString("color", "#f9640f"); fragment.setArguments(args); break; } ft.replace(android.R.id.content, fragment); }
@Override public int getPosition() { return mNativeTab.getPosition(); }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { Tab.setCurrentItem(tab.getPosition()); }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { viewPager.setAdapter(new HomeViewPagerAdapter(getSupportFragmentManager())); viewPager.setCurrentItem(tab.getPosition()); }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { config.refresh(); mViewPager.setCurrentItem(tab.getPosition()); }