Retrieve a Fragment from a ViewPager

前端 未结 23 2521
逝去的感伤
逝去的感伤 2020-11-21 11:13

I\'m using a ViewPager together with a FragmentStatePagerAdapter to host three different fragments:

  • [Fragment1]
  • [Fragment2]<
23条回答
  •  悲&欢浪女
    2020-11-21 11:58

    Hey I have answered this question here. Basically, you need to override

    public Object instantiateItem(ViewGroup container, int position)

    method of FragmentStatePagerAdapter.

提交回复
热议问题