Reputation: 627
I am using view pager in my application i have a jump to feature in my application the user can jump to the desired page by selecting some index of grid view.
I have no idea which method of view pager will select the desired page like in tab host we have a method for this
TabHost.setCurrentTab(tabindex);
i need some thing like this
Upvotes: 0
Views: 66
Reputation: 5271
Try this:
pager.setCurrentItem(Integer.parseInt(jumpTo_ET.getText().toString())-1);
//pager is your View Pager Object and
//jumpTo_ET is the EditText object from which you are getting the page index to navigate.
Upvotes: 1