title: Changing pagetitle in Android Viewpager
body: <p>I have a <code>ViewPager</code> in which I am using the getPageTitle method to get the title of the current page. </p>
  
  <p>Here is the Adapter code:</p>
  
  <pre><code>    @Override
      public Fragment getItem(int i) {
          details = productData.get(i);
          Fragment fragment = new ProductViewFragment();
          Bundle args = new Bundle();
          args.putInt(ProductViewFragment.ARG_SECTION_NUMBER, i + 1);
          fragment.setArguments(args);
          return fragment;
      }
  
      @Override
      public int getCount() {
          return productData.size();
      }
  
      public CharSequence getPageTitle(int position) 
      {
        return (position+1)+" of "+myData.size();
      }
  </code></pre>
  
  <p>Now I would like to update the page titles of the previous and next fragments. I want to name them as "previous" and "next". And it should be updated dynamically on subsequent pages also. </p>
  
  <p>I am able to get the current page title number. For example, when I view the 5th fragment, the current fragment will show the title properly. And at both the corners of the ViewPager it shows the previous page title number on the left and next page title number on the right. Now, I want to have the page titles as "previous" on the left and "next" on the right, similar to the Gmail app and how it shows the mail count in the ViewPager. </p>
  
  <p>The main thing I want to know is how can I access/modify the page title data of the next/previous fragments from the current fragment like they do in the Gmail app?</p>