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


解决办法 在使用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();

            Glide.with(this).pauseRequest();

        }

子线程所有的this 都要写成getApplicationContext //这个主要针对于在子线程使用Glide


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM