Glide错误java.lang.IllegalArgumentException: You cannot start a load for a destr

来源:互联网 发布:产品的网络营销策划书 编辑:程序博客网 时间:2024/05/23 22:17

解决办法 在使用Glide的那段代码加是否在主线程判断

if(Util.isOnMainThread()) {                                Glide.with(ClassifyItemDetailActivity.this).load(ConstantsYiBaiSong.CLASSIFY_LIST_ITEM_DETAIL_IMAGE                                        + lists.get(i).get(                                        "face"))                                        .diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView);                            }

在onDestory加

@Override    protected void onDestroy() {        super.onDestroy();        if(Util.isOnMainThread()) {            Glide.get(this).clearMemory();        }        }

问题解决。不要问我为什么 因为报错的根源都是判断结论不在主线程。


转自:http://www.ithao123.cn/content-10795739.html

0 0
原创粉丝点击