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 ...
随机推荐
- ios frame,bound和center
frame:指的是视图在父视图的坐标系统中的大小和位置. bound:指的是视图在试图本身的坐标系统中的大小(位置起点是原点). center:指的是视图在父视图坐标系统中的中心点. 贴张苹果官网的图 ...
- 关于select 控件
通过http://www.w3school.com.cn/tiy/t.asp?f=html_select 的测试,测得,select 控件值最多106个. Q:easyui的datagrid中能做到 ...
- Uri详解之——Uri结构与代码提取
目录(?)[+] 前言:依然没有前言…… 相关博客:1.<Uri详解之——Uri结构与代码提取>2.<Uri详解之二——通过自定义Uri外部启动APP与Notification启动& ...
- c++ comment
一.匈牙利命名法[Hungarian]: 广泛应用于象 Microsoft Windows 这样的环境中. Windows 编程中用到的变量(还包括宏)的命名规则匈牙利命名法,这种命名技术是由一 位能 ...
- [Tools] Deploy a Monorepo to Now V2
Now by Zeit has recently been updated and now supports multi-language monorepos. In this lesson we'l ...
- 微信小程序 - 关于下拉刷新
// 拉取数据 fetchData: function() { wx.request({ url: 'http://v.juhe.cn/toutiao/index', data: { type: '' ...
- document.querySelector()与document.querySelectorAll()
document.querySelector()与document.querySelectorAll() CreationTime--2018年7月1日10点49分 Author:Marydon ...
- Java jar转exe
http://www.blogjava.net/baoyaer/articles/97405.html Java转exe篇: 实现方式:Eclipse搭配JSmooth(免费). 1.先由Eclips ...
- MvcPager源代码—PagerOptions.cs
public class PagerOptions { public PagerOptions() { AutoHide = true; ...
- Expression构建DataTable to Entity 映射委托 sqlserver 数据库里面金额类型为什么不建议用float,实例告诉你为什么不能。 sql server 多行数据合并成一列 C# 字符串大写转小写,小写转大写,数字保留,其他除外 从0开始用U盘制作启动盘装Windows10系统(联想R720笔记本)并永久激活方法 纯CSS打造淘宝导航菜单栏 C# Winform
Expression构建DataTable to Entity 映射委托 1 namespace Echofool.Utility.Common { 2 using System; 3 using ...