chrisbanes/PhotoView — pull request #42 by robUx4 (2013-03-25 09:23:34+00:00)
Title: Crash in PhotoViewAttacher after the view is gone

I also get crashes when the fling is still being run but the view is gone.
The patch not tested in production yet, extra tests in the fling Runnable may be necessary

This is the kinf of crash I get:
java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.
at uk.co.senab.photoview.PhotoViewAttacher.getImageView(PhotoViewAttacher.java:226)
at uk.co.senab.photoview.PhotoViewAttacher$FlingRunnable.run(PhotoViewAttacher.java:909)
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:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)