1

I know that using ViewPager I can get current fragment index but how can I get previous fragment index?

Its not a problem when I go forward (i-1) but how about going backward? Maybe their is a way to detect which direction I swipe? or something else

Alex Kapustian
  • 4,843
  • 14
  • 49
  • 77

1 Answers1

0

I just answered a similar question --> Holding references to the fragments returned by PagerAdapter. In that question the user wants to connect the current fragment to a Server and disconnect the previous one, so only one connection is active at any given time.

Community
  • 1
  • 1
ILovemyPoncho
  • 2,682
  • 2
  • 22
  • 34