Take the 2-minute tour ×

I have FragmentA ,FragmentB ,FragmentC in ViewPager

When app runs the first time I state on FragmentA

FragmentB create and call method onResume() automatic

When I move to FragmentB I want to call method onResume() again

for start some animation again.

How do it?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You will need to implement a ViewPager.OnPageChangeListener (or a ViewPager.SimpleOnPageChangeListener) and attach it to the ViewPager. Depending on the effect you want, you can use either of the following two options:

  1. onPageSelected(int position) (in combination with SCROLL_STATE_SETTLING) - Called when the scroll state changes.
  2. onPageScrollStateChanged(int state) - This method will be invoked when a new page becomes selected.

You can then (re)start the animation when those methods get called.

share|improve this answer

Your Answer


