I'm a little confused with what I should be doing here so was hoping someone could point me in the right direction.
I have a Viewpager
that has around 25 pages to it, I can swipe left and right through it fine. I also have a navigation drawer that I want to use to jump to a specific page within the 25 pages. I.e. say Page 1, 5 ,15 and 25.
I've been having a look at the setCurrentItem()
and getCurrentItem()
methods but not really sure how to implement them or if that's what I should be using.
My idea was to use the setCurrenItem()
within the onNavigationDrawerItemSelected()
method via a switch statement. Would that work? If so, I presume I'd need to give each of my fragments an int argument to specify each page and then use that from setCurrentItem()
?
Any advice would be appreciated!