ViewPager call setUserVisibleHint after first Fragment is loaded

后端 未结 6 1415
梦谈多话
梦谈多话 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:06

    You have to call manually mViewPagerListener.onPageSelected(0); in onCreateView in your root activity/fragment.

提交回复
热议问题