ViewPager call setUserVisibleHint after first Fragment is loaded

后端 未结 6 1421
梦谈多话
梦谈多话 2020-12-13 23:40

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

6条回答
  •  不知归路
    2020-12-14 00:15

    I dont understand what you need exactly but you can detect the page of the current fragment by calling ViewPager.getCurrentItem that return integer.

    Hope it helps.

    Good luck.

提交回复
热议问题