可以覆写ViewPager的setPrimaryItem方法:
new FragmentStatePagerAdapter(getSupportFragmentManager()) { ... @Override public void setPrimaryItem(ViewGroup container, int position, Object object) { super.setPrimaryItem(container, position, object); if(object instanceof XXXFragment) { ...... } } ... }