title: Android ViewPager Prev/Next Button
body: <p>Okay, so I'm developing an Android app that utilises a ViewPager to display pages.</p>
  
  <p>Within each page, I have a set of buttons to use for navigating between pages (in addition to the swiping between pages). These buttons are for "first page", "previous page", "next page" and "last page".</p>
  
  <p>What I can't figure out how to do is engineer a mechanism to enable a page change on a button click.</p>
  
  <p>Anyone have any ideas?</p>
  
  <p>ETA: To better explain the setup, the buttons are declared within each page's layout, and are inflated with the rest of the layout within the PagerAdapter. My problem is that I can't reference the ViewPager from within the PagerAdapter. Or at least, I can't think of a way to do it.</p>