void updateAdapter(PagerAdapter oldAdapter, PagerAdapter newAdapter) {
    if (oldAdapter != null) {
      oldAdapter.unregisterDataSetObserver(mPageListener);
      mWatchingAdapter = null;
    }
    if (newAdapter != null) {
      newAdapter.registerDataSetObserver(mPageListener);
      mWatchingAdapter = new WeakReference<PagerAdapter>(newAdapter);
    }
    if (mPager != null) {
      mLastKnownCurrentPage = -1;
      mLastKnownPositionOffset = -1;
      updateText(mPager.getCurrentItem(), newAdapter);
      requestLayout();
    }
  }
Set the {@link Gravity} used to position text within the title strip.
Only the vertical gravity component is used.

@param gravity {@link Gravity} constant for positioning title text
sample/src/main/java/android/support/v4/view/PagerTitleStripV22.java