草莓大草莓 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 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化