草莓大草莓 2022-07-07 10:10 采纳率: 50%
浏览 72
已结题

glide Already released

问题遇到的现象和发生背景

java.lang.IllegalStateException: Already released

问题相关代码,请勿粘贴截图
    if (CommonUserUtil.isForeverVip(nimUser.account) && !isBlurry) {
                    holder.mRlStoke.visibility = View.VISIBLE
                    holder.mIconAvatarLayout.visibility = View.GONE

                    Glide.with(mContext).load(R.drawable.image_forever_storke).centerInside()
                            .into(holder.mRlAvatarStroke)
                    var params = holder.mNameLayout.layoutParams as RelativeLayout.LayoutParams
                    params.topMargin = ScreenUtil.getDimension(R.dimen.dp_10)
                    holder.mNameLayout.layoutParams = params

                    contentparams.marginStart = ScreenUtil.getDimension(R.dimen.dp_0)
                    if (isTeam) {
                        contentparams.topMargin = ScreenUtil.getDimension(R.dimen.dp_0)
                    } else {
                        contentparams.topMargin = ScreenUtil.getDimension(R.dimen.dp_5)
                    }
                    holder.mContentTextView2.layoutParams = contentparams
                    if (nimUser != null) {
                        GlideUtil.loadCircleImage(mContext, nimUser.avatar.toString(), holder.mIconImageView)
                    } else {
                        holder.mIconAvatarLayout.getAvatarImageView()?.setImageResource(R.drawable.user_load_default_image)
                        holder.mIconAvatarLayout.visibility = View.VISIBLE
                        holder.mRlStoke.visibility = View.GONE
                    }
                } else {
                    holder.mIconAvatarLayout.loadImage(nimUser, isBlurry = mBlurry)
                }
            } else {
                holder.mIconAvatarLayout.getAvatarImageView()?.setImageResource(R.drawable.user_load_default_image)
            }

Glide.with(mContext).asBitmap().load(icon).centerCrop()
.into(object : CustomTarget<Bitmap?>(ScreenUtil.getDimension(R.dimen.dp_60), ScreenUtil.getDimension(R.dimen.dp_53)) {
@SuppressLint("Range")
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap?>?) {
try {
textView.text = SmileUtils.getSmiledText(mContext, textView, body)
if (isleft) {
var resoureHorizontal = ImageUtils.toHorizontalMirror(resource)
var ninePatchBuilder = NinePatchBuilder(mContext.resources, resoureHorizontal)
textView.background = ninePatchBuilder.addXCenteredRegion(2).addYCenteredRegion(2).build();
textView.visibility = View.VISIBLE
textView.setTextColor(Color.parseColor(textColor))
} else {
var ninePatchBuilder = NinePatchBuilder(mContext.resources, resource)
textView.background = ninePatchBuilder.addXCenteredRegion(2).addYCenteredRegion(2).build();
textView.visibility = View.VISIBLE
textView.setTextColor(Color.parseColor(textColor))
}
}catch (e:Exception){

                    }
                }

                override fun onLoadCleared(placeholder: Drawable?) {

                }
            })
运行结果及报错内容
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:628)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at com.innovation.driftbottle.base.AppBaseActivity.onStart(AppBaseActivity.kt:111)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436)
at android.app.Activity.performStart(Activity.java:8170)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3741)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:232)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:212)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:184)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:102)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2312)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8259)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

2条回答 默认 最新

  • 不会写代码的猴子 Android领域优质创作者 2022-07-07 13:47
    关注

    错误没有截全
    at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:628)
    你把这部分代码逻辑贴出来

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 7月15日
  • 已采纳回答 7月7日
  • 创建了问题 7月7日

悬赏问题

  • ¥15 CSS通配符清除内外边距为什么可以覆盖默认样式?
  • ¥15 SPSS分类模型实训题步骤
  • ¥15 求解决扩散模型代码问题
  • ¥15 工创大赛太阳能电动车项目零基础要学什么
  • ¥20 limma多组间分析最终p值只有一个
  • ¥15 nopCommerce开发问题
  • ¥15 torch.multiprocessing.spawn.ProcessExitedException: process 1 terminated with signal SIGKILL
  • ¥15 QuartusⅡ15.0编译项目后,output_files中的.jdi、.sld、.sof不更新怎么解决
  • ¥15 pycharm输出和导师的一样,但是标红
  • ¥15 想问问富文本拿到的html怎么转成docx的