PhotoView: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
hi,
I try to use your library but i have the exception bellow when zoom in.
08-30 22:44:43.437 20210-20210/com.******E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at android.support.v4.widget.ViewDragHelper.shouldInterceptTouchEvent(ViewDragHelper.java:1004)
at android.support.v4.widget.DrawerLayout.onInterceptTouchEvent(DrawerLayout.java:855)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1852)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1952)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1952)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1952)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1966)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418)
at android.app.Activity.dispatchTouchEvent(Activity.java:2424)
at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent(ActionBarActivityDelegateICS.java:255)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1914)
at android.view.View.dispatchPointerEvent(View.java:7564)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:174)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:5472)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:5512)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:530)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 30 (10 by maintainers)
Commits related to this issue
- Possible fix for #72 Tested against 4.x, all functions works and the underlying ViewPager/DrawableLayout doesn't report any exceptions. — committed to Baseflow/PhotoView by smarek 11 years ago
- Fixes #103 — committed to Baseflow/PhotoView by smarek 11 years ago
- Use better ImageView lib for gallery. fixes #6 But see https://github.com/chrisbanes/PhotoView/issues/72 — committed to eugenkiss/chanobol by eugenkiss 9 years ago
- Fix for regression on issue #72. If the PhotoView gesture detector handles scaling or dragging the PhotoView, we will continue to block the parent view from receiving onTouch events. If the gesture d... — committed to bherbst/PhotoView by bherbst 9 years ago
- Fix for regression on issue #72. If the PhotoView gesture detector handles scaling or dragging the PhotoView, we will continue to block the parent view from receiving onTouch events. If the gesture d... — committed to bherbst/PhotoView by bherbst 9 years ago
- Merge pull request #240 from tanis7x/dev Fix for regression on issue #72. — committed to Baseflow/PhotoView by smarek 9 years ago
Yes, it looks like issue in Support v4 library, below is implementation equivalent to HackyViewPager for DrawerLayout. I will add the class to Sample project and close this issue after merge.
use in layout like this
I keep getting the ArrayIndexOutOfBoundsException even though I’ve implemented the fix described in smareks comment.
I can see that the my ImageView is part of the HackyDrawerLayout and that the onInterceptTouchEvent in that class is run at times, but the exception is never catched when the exception occur.
This is my
onInterceptTouchEvent:And my xml file:
Any ideas?