I have extended the ViewPager class and implemented onPageChangeListener. I use this ViewPager in conjunction with a CirclePageIndicator inside a SherlockFragment. The ViewPager
setOnPageChangeListener
is deprecated.
use addOnPageChangeListener
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
});