When the viewpager is restarted, it keeps executing the previous fragment

前端 未结 1 621
野性不改
野性不改 2021-01-23 19:37

The activity has a homeFragment that contains a viewPager.

If I refresh the homeFragment, the viewPager is also regen

1条回答
  •  走了就别回头了
    2021-01-23 20:20

    You must call the

    viewpager.setAdapter(null)
    

    or in kotlin

    viewpager.adapter = (null)
    

    It will be reset the ViewPager to start position.

    0 讨论(0)
提交回复
热议问题