viewpager会出现这个问题,使用viewpager最好自定义重写onInterceptTouchEvent进行try下
java.lang.IllegalArgumentException: pointerIndex out of range pointerIndex=-1 pointerCount=1
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2216)
at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:2066)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2582)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3041)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2728)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3041)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2728)
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
try {
return super.onInterceptTouchEvent(event);
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
return false ;
}
网友评论