Change Tab Programmatically with SlidingTabLayout

前端 未结 1 322
日久生厌
日久生厌 2021-01-12 11:52

I\'m using the SlidingTabLayout example provided by Google. I\'m trying to programmatically switch back to the first tab inside a dialogView that is inside a fragment.

相关标签:
1条回答
  • 2021-01-12 12:32

    You can use:

    viewPager.setCurrentItem(itemIndex);
    

    viewPager being your view pager for the tabs that you specified in the layout as

    android.support.v4.view.ViewPager

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