【发布时间】:2019-09-08 10:22:07
【问题描述】:
我正在使用Glide v4 加载我的图片,但我的应用遇到了错误:
I/Glide: Root cause (1 of 1) com.bumptech.glide.load.HttpException: Not Found
at com.bumptech.glide.integration.okhttp3.OkHttpStreamFetcher.onResponse(OkHttpStreamFetcher.java:73)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:206)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
第一次加载时会发生这种情况,但是当我再次重新加载时,图像现在出现了。
我正在从我的RecyclerView 适配器加载图像,例如:
class MyRecyclerViewAdapter(private val glideApp: GlideRequests): RecyclerView.Adapter<MyRecyclerViewAdapter.ViewHolder>() {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
//... some stuff
// Set a data
glideApp.asBitmap()
.load(img_url)
.into(holder.itemView.ivImageHolder)
// Set a data
}
}
感谢您的帮助。
【问题讨论】:
-
你找到解决办法了吗?
标签: android android-recyclerview android-glide httpexception