In my application, I have a ViewPager which holds many swipeable Tabs with Fragments inside. I use the setUserVisibleHint method to detect when a Fragment
setUserVisibleHint
Fragment
I dont understand what you need exactly but you can detect the page of the current fragment by calling ViewPager.getCurrentItem that return integer.
ViewPager.getCurrentItem
Hope it helps.
Good luck.