onPageSelected isn't triggered when calling setCurrentItem(0)

后端 未结 10 1784
梦如初夏
梦如初夏 2020-12-22 20:13

I have an Activity with a ViewPager which displays a bunch of pictures. When it starts the ViewPager\'s position is set based on what the user selected in a previous Activit

10条回答
  •  余生分开走
    2020-12-22 20:27

    If the ViewPager is in a fragment, in the onViewCreated method, call mPager.setOnPageChangeListener(this)

提交回复
热议问题