protected void buildPage() { mViewPager.setAdapter(new MPageAdapter(mFragmentManager)); mIndicator.setViewPager(mViewPager); OnPageChangeListener opcl = new OnPageChangeListener() { @Override public void onPageSelected(int arg0) { // TODO Auto-generated method stub mCurrFragment = (FragSearchList) getChildFragmentManager().findFragmentByTag(Optional_Tab[arg0]); if (mSEditText != null) { String keyWords = mSEditText.getText().toString(); if (mCurrFragment != null && keyWords != null) { mCurrFragment.getmSAdp().getFilter().filter(keyWords); } } } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { // TODO Auto-generated method stub } @Override public void onPageScrollStateChanged(int arg0) { // TODO Auto-generated method stub } }; mIndicator.setOnPageChangeListener(opcl); if (mIntentType == Type_Intent_Simu) { mViewPager.setCurrentItem(1); mCurrFragment = (FragSearchList) getChildFragmentManager().findFragmentByTag(Optional_Tab[1]); } }
public void toggleGmSm() { mViewPager.setCurrentItem(mViewPager.getCurrentItem() == 0 ? 1 : 0); }