title: Android ViewPager when swiping on last screen
body: <p>Im having trouble figuring out how to capture a swipe event on the last page of a view pager.</p>
  
  <p>Basically the requirement is that when the user is on the last page, and they try to swipe to get to the next page, the activity should close.</p>
  
  <p>I've tried doing this onPageScrolled but I cant seem to differentiate a left or right swipe when in there. When on the last page, the user should still maintain the functionality to move to the previous page.</p>
  
  <p>So basically the case is</p>
  
  <pre><code>When on last page
      if swipe prev (do normal behaviour)
      if swipe next (finish activity)
  </code></pre>
  
  <p>Can anyone provide any suggestions?
  Thanks</p>