Baseflow / Baseflow/PhotoView

IllegalStateException: Matrix can not be modified

Open
#558 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

I'm getting the following crash when I'm trying to execute this line:

photoViewAttacher.getDisplayMatrix(imageview.getMatrix());

Fatal Exception: java.lang.IllegalStateException: Matrix can not be modified
at android.graphics.Matrix$1.oops(Matrix.java:43)
at android.graphics.Matrix$1.set(Matrix.java:48)
at uk.co.senab.photoview.PhotoViewAttacher.getDisplayMatrix(PhotoViewAttacher.java:691)
at com.mypackage.MyActivity.onMatrixChanged(CustomColoringActivity.java:213)
at uk.co.senab.photoview.PhotoViewAttacher.setImageViewMatrix(PhotoViewAttacher.java:875)
at uk.co.senab.photoview.PhotoViewAttacher.checkAndDisplayMatrix(PhotoViewAttacher.java:723)
at uk.co.senab.photoview.PhotoViewAttacher.setRotationBy(PhotoViewAttacher.java:327)
at uk.co.senab.photoview.PhotoViewAttacher.resetMatrix(PhotoViewAttacher.java:859)
at uk.co.senab.photoview.PhotoViewAttacher.updateBaseMatrix(PhotoViewAttacher.java:949)
at uk.co.senab.photoview.PhotoViewAttacher.onGlobalLayout(PhotoViewAttacher.java:449)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:682)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1868)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1120)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4585)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4953)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
at dalvik.system.NativeStart.main(NativeStart.java)

Any ideas how can I fix it? I tried creating new matrix and using it instead, but got same result.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.