title: How to get position of first and last position of viewpager?
body: <p>I want to hide left arrow when the first position of a ViewPager and hide right arrow when the last position of a ViewPager. And then , I also want to show current page number with TextView like (5/30). 5 is current page number and 30 is total page number. Thank You Sir.</p>
  
  <p>Here is my code; </p>
  
  <pre><code>mPager.beginFakeDrag();
  leftNav = (ImageButton) findViewById(R.id.left_nav);
  rightNav = (ImageButton) findViewById(R.id.right_nav);
  txt_count = (ImageButton) findViewById(R.id.txt);
  
  int tab = mPager.getCurrentItem();
  if (tab == 0){
      leftNav.setVisibility(View.GONE); // hide all position :(
  }
  
  leftNav.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          int tab = mPager.getCurrentItem();
          if (tab &gt; 0) {
              tab--;
              mPager.setCurrentItem(tab);
          } else if (tab == 0) {
              mPager.setCurrentItem(tab);
          }
      }
  });
  
  rightNav.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          int tab = mPager.getCurrentItem();
          tab++;
          mPager.setCurrentItem(tab);
      }
  });
  </code></pre>