Glide Exception:"You must not call setTag() on a view Glide is targeting"
来源:互联网 发布:王思仪铁观音淘宝店 编辑:程序博客网 时间:2024/06/07 15:36
How to solve the Glide Exception:”You must not call setTag() on a view Glide is targeting”
The following error encountered when you use the Glide image loading framework in the project.
异常原因:
Glide加载的iamgeView调用了setTag()方法,因为Glide已经默认为ImageView设置了Tag。
解决方案:
首先,在\res\values\文件夹下创建ids.xml文件(如果没有该文件的话),并添加以下代码:
<?xml version="1.0" encoding="utf-8"?><resources> <item type="id" name="tag_glide" /></resources>
其次,在项目中创建Application类(如果还没有Application类,名字自己起,根据你的项目),然后在Application的onCreate方法中添加:ViewTarget.setTagId(R.id.tag_glide);
例如:
public class SlideShowApp extends Application { @Override public void onCreate() { super.onCreate(); ViewTarget.setTagId(R.id.tag_glide); }}
最后,记得将在你的配置文件AndroidManifest.xml中做改动:application标签下添加android:name=”.SlideShowApp”,SlideShowApp替换为你的Application的类名。
例如:
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yuangudashen.testapp.slideshow"> <application android:name=".SlideShowApp" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme.NoActionBar.FullScreen"> <activity android:name="com.yuangudashen.testapp.slideshow.MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application></manifest>
阅读全文
1 0
- Glide Exception:"You must not call setTag() on a view Glide is targeting"
- Error “You must not call setTag() on a view Glide is targeting” when use Glide
- Glide异常:java.lang.IllegaliArgumentException:You must not call setTag() on a view Glide is targeting
- java.lang.IllegalArgumentException: You must not call setTag() on a view Glide is targeting
- You must not call setTag() on a view Glide is targeting的解决方案
- You must not call setTag() on a view Glide is targeting
- java.lang.IllegalArgumentException: You must not call setTag() on a view Glide is targeting
- You must not call setTag() on a view Glide is targeting的解决方案
- 关于You must not call setTag() on a view Glide is targeting错误处理
- Glide加载图片遇到的错误:You must not call setTag() on a view Glide is targeting
- Gilde刷新图片闪烁和You must not call setTag() on a view Glide is targeting如何解决
- You may not call SetData on a resource while it is actively set on the GraphicsDevice. Unset it from
- Glide加载图片出现java.lang.IllegalStateException: Can't call reconfigure() on a recycled bitmap
- 关于向父view添加相同的view问题!The specified child already has a parent. You must call removeView() on the chil
- You must call removeView() on the child'
- The specified child already has a parent. You must call removeView() on the chil
- The specified child already has a parent. You must call removeView() on the
- Glide-You cannot start a load for a destroyed activity
- python 数据类型之间转换
- malloc,calloc,realloc
- POJ 3063 Sherlock Holmes 笔记
- effective c++ item13:使用对象管理资源
- Spring整合Mybatis(一)
- Glide Exception:"You must not call setTag() on a view Glide is targeting"
- Linux下SGI的hashtable的调用方法,(之前一直调用好多错误,网上也找不到答案,现在终于搞定了)
- Tex Quotes (P45) / POJ 1488
- ubuntu 14.04 samba
- Counting Words(句子切割)
- Lua基础---一维数组与多维数组
- 从零开始写javaweb框架笔记22-使框架具备AOP特性-事务管理简介
- 同时安装两个不同位数jdk,分别配置eclipse
- Redis 数据类型