signed

QiShunwang

“诚信为本、客户至上”

Android之giide加载失败提示You can‘t start or clear loads in RequestListener or Target callbacks If you‘re t

2021/3/21 0:11:30   来源:

1 问题

用glide进行加载视频数据的时候,加载错误了再用glide进行加载一次,代码如下

                var iv = helper.getView<ImageView>(R.id.download_iv)
                iv?.let {
                        val transform = RoundedCornersTransform(mContext, UnitUtils.dip2px(mContext, 12.toFloat()).toFloat())
                        transform.setNeedCorner(true, true, true, true)
                        val options = RequestOptions()
                        if (true) {
                            options.placeholder(RandomColorUtils.getRandomColor())
                        }
                        options.transform(transform)
                        Glide.with(mContext).load(data).error(ColorDrawable()).listener(object : RequestListener<Drawable?> {
                            override fun onLoadFailed(e: GlideException?, model: Any, target: Target<Drawable?>, isFirstResource: Boolean): Boolean {
                                Glide.with(mContext).load(