code: @Override
      public boolean onTouchEvent(MotionEvent ev) {
          try {
              if (ev == null || getAdapter() == null || getAdapter().getCount() == 0) {
                  return false;
              }
              return super.onTouchEvent(ev);
          } catch (RuntimeException e) {
              Log.e(TAG, "Exception during WrapContentViewPager onTouchEvent: " +
                      "index out of bound, or nullpointer even if we check the adapter before " + e.toString());
              return false;
          }
      }
docs: Fixes for "java.lang.IndexOutOfBoundsException Invalid index 0, size is 0"
  on "android.support.v4.view.ViewPager.performDrag"