سؤال

I have implemented android appcompat actionbar with swipeable tab views using viewpager. I have set two tabs (two fragments). On first fragment (First tab) , I have a button click listener. In this button click listener I need to show the second tab. Though I can swipe between the tabs, I want to call second tab on button click in first tab. How to achieve this?

هل كانت مفيدة؟

المحلول

Well, I found the solution. On button click listener in first tab, I set actionBar.setSelectedNavigationItem(1);

This takes me to the second tab :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top