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.
I see a scrollToTab(int tabIndex, int positionOffset). How can I call this to return to the first tab?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With