Skip to content

Commit b22b363

Browse files
committed
Update library/src/uk/co/senab/photoview/PhotoViewAttacher.java
fix  ImageView no longer exists. You should not use this PhotoViewAttacher any more. the cleanup don't work so i fixed it like this.
1 parent d9d8611 commit b22b363

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/uk/co/senab/photoview/PhotoViewAttacher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ public final boolean canZoom() {
176176
*/
177177
@SuppressWarnings("deprecation")
178178
public final void cleanup() {
179-
if (null != mViewTreeObserver && mViewTreeObserver.isAlive()) {
180-
mViewTreeObserver.removeGlobalOnLayoutListener(this);
179+
if (null != mImageView) {
180+
mImageView.get().getViewTreeObserver().removeGlobalOnLayoutListener(this);
181181
}
182182
mViewTreeObserver = null;
183183

0 commit comments

Comments
 (0)