java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2139)
at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:2064)
my answer:
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
try {
boolean intercept = super.onInterceptTouchEvent(swapTouchEvent(event));
//If not intercept, touch event should not be swapped.
swapTouchEvent(event);
return intercept;
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
return false;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
try {
return super.onTouchEvent(swapTouchEvent(ev));
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
return false;
}
my answer: