The full error is: java.lang.IllegalState

ImageView no longer exists. You should not use this PhotoViewAttacher any more.

The full error is:

写道
java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.
uk.co.senab.photoview.PhotoViewAttacher.getImageView(PhotoViewAttacher.java:209)
uk.co.senab.photoview.PhotoViewAttacher.onSingleTapConfirmed(PhotoViewAttacher.java:351)
android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:320)
 
在PhotoViewAttacher  文件中 更改cleanup方法
 参考

https://github.com/chrisbanes/PhotoView/issues/67

 

定位到找到cleanup()代码,
//
写道
@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;
// }
 

修改成

 

 写道

@SuppressLint("NewApi")
@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;
}
}
}
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用内容,错误信息java.lang.IllegalStateException: Failed to load ApplicationContext通常表示应用程序上下文加载失败。根据引用内容,第一步可以检查路径是否正确,确保user-mapper.xml已经修正。第二步可以检查配置文件是否出错,可能需要仔细检查applicationContext.xml文件。第三步可以检查MySQL数据库服务器是否开启,并且确保数据库信息与配置文件匹配。根据给出的引用内容中的错误信息org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityMangerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException,这个错误可能是由于缺少某些类库引起的。建议检查项目的依赖是否正确配置,特别是与javax.xml.bind.JAXBException相关的类库依赖是否存在。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [java.lang.IllegalStateException: Failed to load ApplicationContext](https://blog.csdn.net/qq_50209297/article/details/127454247)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [java.lang.IllegalStateException Failed to load ApplicationContext 解决办法](https://blog.csdn.net/m0_67391401/article/details/126724664)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值