Reputation: 33
I have a main activity with 3 tabs,when i swipe the tabbed indicator doesn't move but the layout changes while selecting a tab the indicator moves and the layout changes too.
Upvotes: 3
Views: 1976
Reputation: 2659
Make sure you have a OnPageChangeListener
attached to your ViewPager
mViewPager.setOnPageChangeListener(
new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
mTabs.getTabAt(position).select();
}
});
Upvotes: 5