Reputation: 4760
I want to simulate a swipe event in Android app.this link is for touch event
Basically I want to slide to the next view when a user swipe on the screen or when he click a button, and the first one is trivial. The second one is complecated that I have to simulate or trigger a swipe event in the OnClickListener of the Button. How can I do that?
Upvotes: 1
Views: 1804
Reputation: 1792
If you already use ViewPager
viewpager.setCurrentItem(i)
where i is a numer of page you want slide into
Upvotes: 3