Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: pointerIndex out of range photoview inside relativelayout #714

Open
androidheight opened this issue Jul 3, 2019 · 2 comments

Comments

@androidheight
Copy link

when multiple time zoom in out image throwing the exception:
java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2106)
at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:2072)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2285)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2684)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2552)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1767)
at android.app.Activity.dispatchTouchEvent(Activity.java:2840)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2513)
at android.view.View.dispatchPointerEvent(View.java:9125)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4632)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4470)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4020)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4073)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4039)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4153)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4047)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4210)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4020)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4073)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4039)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4047)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4020)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6480)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6379)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6350)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6570)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:143)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

@yizems
Copy link

yizems commented Jul 31, 2019

I have same problem;

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:2072)
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)
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)
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)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:565)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1929)
at android.app.Activity.dispatchTouchEvent(Activity.java:3594)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:514)
at android.view.View.dispatchPointerEvent(View.java:12877)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5771)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5535)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4983)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5036)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5002)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5157)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5010)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5214)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4983)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5036)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5002)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5010)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4983)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7803)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7768)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7726)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8007)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:202)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:191)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:7917)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:8061)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1092)
at android.view.Choreographer.doCallbacks(Choreographer.java:893)
at android.view.Choreographer.doFrame(Choreographer.java:806)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1078)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7593)

com.gwmfc.mobile.carloan.usedcar.dev E/CarLoan: ║ at java.lang.reflect.Method.invoke(Nativ
e Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

@yizems
Copy link

yizems commented Aug 2, 2019

@androidheight 你上面的那个是 因为 viewpage 引起的,重写viewpage.onInterceptTouchEvent加一个try catch 就可以了

我的是本库的问题,已经有 pullrequest 处理了, #651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants