java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.
java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.
这个错误今天碰到了,下面是解决方法,直接上代码
/*
* @SuppressWarnings("deprecation")
* public final void cleanup() {
* if (null!= mImageView) {
* mImageView.get().getViewTreeObserver().removeGlobalOnLayoutListener(this);
* }
* mViewTreeObserver = null;
*
* // Clear
* listeners too mMatrixChangeListener = null;
* mPhotoTapListener = null;
* mViewTapListener = null;
*
* // Finally, clear ImageView
* mImageView = null; }
*/
@SuppressWarnings("deprecation")
public final void cleanup() {
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
if (null != mImageView) {
mImageView.get().getViewTreeObserver()
.removeOnGlobalLayoutListener(this);
} if (null != mViewTreeObserver && mViewTreeObserver.isAlive()) {
mViewTreeObserver.removeOnGlobalLayoutListener(this); mViewTreeObserver = null; // Clear listeners too
mMatrixChangeListener = null;
mPhotoTapListener = null;
mViewTapListener = null;
// Finally, clear ImageView
mImageView = null;
} } else {
if (null != mImageView) {
mImageView.get().getViewTreeObserver()
.removeGlobalOnLayoutListener(this);
} if (null != mViewTreeObserver && mViewTreeObserver.isAlive()) {
mViewTreeObserver.removeGlobalOnLayoutListener(this); mViewTreeObserver = null; // Clear listeners too
mMatrixChangeListener = null;
mPhotoTapListener = null;
mViewTapListener = null;
// Finally, clear ImageView
mImageView = null;
}
}
}
java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.的更多相关文章
- 云笔记项目- 上传文件报错"java.lang.IllegalStateException: File has been moved - cannot be read again"
在做文件上传时,当写入上传的文件到文件时,会报错“java.lang.IllegalStateException: File has been moved - cannot be read again ...
- struts2 下载时报java.lang.IllegalStateException
-----------------------------------------struts2 下载时报java.lang.IllegalStateException---------------- ...
- 异常java.lang.IllegalStateException的解决
在初始化viewPagerAdapter时,显示异常.从网上找了找有两类这样的问题,一种是说给一个视图设置了两个父类,如: TextView tv = new TextView();layout.ad ...
- 开发问题及解决--java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android=" ...
- java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content&q ...
- tomcat启动时检测到循环继承而栈溢出的问题:Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/test] due to a StackOverflowError. Possible root causes include
最近在公司更新一个老项目的时候,发现部署项目后tomcat报错,错误如下: Caused by: java.lang.IllegalStateException: Unable to complete ...
- myeclipse 无法启动 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
把myeclipse10 按照目录完整拷贝到了另外一台电脑, 另外的目录 原安装目录 D\:\soft\i\myeclipse10 新安装目录 E\:\soft\myeclipse10 双击启动失败, ...
- java.lang.IllegalStateException:Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx...}: java.lang.IllegalSta ...
- java.lang.IllegalStateException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead
java.lang.IllegalStateException: Not allowed to create transaction on sharedEntityManager - use Spri ...
随机推荐
- 管理 node 版本,选择 nvm 还是 n?
来源:http://taobaofed.org/blog/2015/11/17/nvm-or-n/ 引子 我本机安装着 nvm,而 node 本来一直运行在 0.x 的老版本上.后来为了跑 ES6,我 ...
- sass高级语法的补充
1. 继承 2.混入 3.函数 我这篇博客需要点基础才能看懂, 但我这篇博客是对上一篇的 sass高级语法 的补充 从这方面来看也无所谓了
- 转:敏捷方式scrum 方案
http://www.cnblogs.com/taven/archive/2010/10/17/1853386.html 现在敏捷开发是越来越火了,人人都在谈敏捷,人人都在学习Scrum和XP... ...
- zoj 3882 Help Bob(zoj 2015年7月月赛)
Help Bob Time Limit: 2 Seconds Memory Limit: 65536 KB There is a game very popular in ZJU at pr ...
- C# Redis Server分布式缓存编程(一)
这篇文章我将介绍如果用最简洁的方式配置Redis Server, 以及如何使用C#和它交互编程 一. 背景介绍 Redis是最快的key-value分布式缓存之一 缺点: 没有本地数据缓冲, 目前还没 ...
- MSSQL注入SA权限不显错模式下的 入 侵
一般新手扫到不显错的SA(systemadmin)的注入点时,虽然工具能猜表列目录但还是很麻烦有的人就直接放弃了,今天我给大家演示下如何利用.方法很简单大家看操作. 我这里使用的是 火狐的插件提交参数 ...
- JavaScript target与currentTarget区别
1.DOM事件绑定到父元素 <!DOCTYPE html> <html lang="zh"> <head> <meta charset=& ...
- [译] 通过 contentEditable 属性创建一个所见即所得的编辑器(富文本编辑器)
译者注 这只是一篇入门教程,介绍了一些基础知识,仅供参考,切不可因此觉得富文本编辑器很简单. 创建富文本编辑器是一个非常复杂的工程,需要考虑到方方面面,也有很多坑(请参考原文第一条评论). 为免误导大 ...
- 500 lines or less
今天碰到一本书 <500 lines or less>突然就想在博客上记录一下自己的阅读经历了. 现在记录一下这本书的地址 http://aosabook.org/en/index.htm ...
- 转:HTTP协议--- multipart/form-data请求分析
转自:http://blog.csdn.net/five3/article/details/7181521 首先来了解什么是multipart/form-data请求: 根据http/1.1 rfc ...