Vaibhav Mishra Vaibhav Mishra - 1 year ago 85
Android Question

How to programmatically show next view in ViewPager?

I created a ViewPager and everything is working fine, however I want to have a previous next button outside of ViewPager which can be used to navigate inside ViewPager. How can I go to next Item on ViewPager without swiping manually?

Answer Source

As blessenm answered viewpager.setCurrentItem(int index) is the way to go.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download