In AppSectionsPagerAdapter
constructor: add this
mViewPager.setOnPageChangeListener(this);
(this assume the ViewPager is an instance variable named mViewPager
)
Or, as an alternative in the MainActivity.onCreate()
:
mViewPager.setOnPageChangeListener(mAppSectionPageAdapter);
(this assume the AppSectionPageAdapter is in a variable named mAppSectionPageAdapter
)