点开预览或者横向列表 ,点开第一张图片,先正着滑动到最后,然后关闭大图,再点开,然后倒着滑动某张图片后,再关闭大图预览,再点开,滑动就会出现崩溃了,也就是上面所抛出的异常。
06-19 09:12:43.856 277-369/? E/SurfaceFlinger: Failed to find layer (indi.liyi.example/indi.liyi.example.ui.VerticalListActivity#0) in layer parent (no-parent).
06-19 09:13:03.884 13083-13083/indi.liyi.example E/AndroidRuntime: FATAL EXCEPTION:
mainProcess: indi.liyi.example, PID: 13083java.lang.RuntimeException:
Canvas: trying to use a recycled bitmap android.graphics.Bitmap@ff78def
at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:55)
at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:226)
at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
at android.widget.ImageView.onDraw(ImageView.java:1367)
at android.view.View.draw(View.java:19315)
at android.view.View.updateDisplayListIfDirty(View.java:18232)
at android.view.View.draw(View.java:19030)
at android.view.ViewGroup.drawChild(ViewGroup.java:4297)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4083)
at android.view.View.updateDisplayListIfDirty(View.java:18223)
at android.view.View.draw(View.java:19030)
at android.view.ViewGroup.drawChild(ViewGroup.java:4297)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4083)
at android.view.View.draw(View.java:19323)
at android.support.v4.view.ViewPager.draw(ViewPager.java:2426)
at android.view.View.updateDisplayListIfDirty(View.java:18232)
at android.view.View.draw(View.java:19030)
at android.view.ViewGroup.drawChild(ViewGroup.java:4297)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4083)
at android.view.View.draw(View.java:19323)
at android.view.View.updateDisplayListIfDirty(View.java:18232)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4281)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4261)
at android.view.View.updateDisplayListIfDirty(View.java:18181)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4281)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4261)
at android.view.View.updateDisplayListIfDirty(View.java:18181)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4281)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4261)
at android.view.View.updateDisplayListIfDirty(View.java:18181)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4281)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4261)
at android.view.View.updateDisplayListIfDirty(View.java:18181)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:669)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:675)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:783)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3117)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2926)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2464)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1446)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7014)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:916)
at android.view.Choreographer.doCallbacks(Choreographer.java:728)
at android.view.Choreographer.doFrame(Choreographer.java:660)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:902)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
Process: com.liyi.example, PID: 22874
java.lang.NullPointerException: Attempt to invoke virtual method 'float com.liyi.viewer.ViewData.getTargetX()' on a null object reference
at com.liyi.viewer.dragger.WxImageDragger.exit(WxImageDragger.java:179)
at com.liyi.viewer.dragger.WxImageDragger.onRelease(WxImageDragger.java:108)
at com.liyi.viewer.widget.ScaleImageView.onActionUp(ScaleImageView.java:212)
at com.liyi.viewer.widget.ScaleImageView.onTouchEvent(ScaleImageView.java:189)
at android.view.View.dispatchTouchEvent(View.java:9302)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2590)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2257)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2596)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2271)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2596)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2271)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2596)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2271)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2596)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2271)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2596)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2271)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2596)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2271)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2408)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1742)
at android.app.Activity.dispatchTouchEvent(Activity.java:2805)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2369)
at android.view.View.dispatchPointerEvent(View.java:9522)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4729)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4593)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4137)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4190)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4156)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4282)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4164)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4339)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4137)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4190)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4156)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4164)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4137)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6461)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6427)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6388)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6571)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Unable to start activity ComponentInfo{com.nijigenlink.gb/com.liyi.viewer.view.ImagePreviewActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class uk.co.senab.photoview.PhotoView
java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2201)
at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:2066)
at com.liyi.viewer.widget.viewpager.ImagePager.onInterceptTouchEvent(ImagePager.java:68)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2511)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:448)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1829)
at android.app.Activity.dispatchTouchEvent(Activity.java:3307)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:410)
at android.view.View.dispatchPointerEvent(View.java:12015)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4795)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4609)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4293)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4350)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6661)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6635)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6596)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6764)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:186)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:325)
at android.os.Looper.loop(Looper.java:142)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)