我正在使用一个绑定适配器加载图像在一个回收的视图。图像看上去很好。在快速滚动时,我注意到有时我会收到毕加索的“连接泄露”信息。
问题来自死气沉沉的图像链接,硬编码我所有的图像urls指向任何地方都会在屏幕上滚动第一对图像后产生错误。
W/OkHttpClient: A connection to https://s3-eu-west-1.amazonaws.com/ was leaked. Did you forget to close a response body?
代码基本上是相同的。
BindingUtils.kt
object BindingUtils {
@BindingAdap
我试图在全屏视图中显示图像,并使用以下代码:
// Target to write the image to local storage.
Target target = new Target() {
// Target implementation.
}
// (1) Download and save the image locally.
Picasso.with(context)
.load(url)
.into(target);
// (2) Use the cached version of the image and load the Imag
我在使用android:state_pressed时遇到了一个问题
这是我活动的代码:感谢Mahmoud Elmorabea **更新我的最后代码是**
final StateListDrawable stateListDrawable = new StateListDrawable();
final Picasso picasso = Picasso.with(this.getApplicationContext());
target_selected = new Target() {
@Override
public void onBitmapLoa
我知道这个论坛充满了"Android不显示图像“的问题,但这些问题似乎都与我所经历的不一致。
当我使用调试器并逐步遍历我的代码时,它工作得很好,并显示了图像。但是,当我不停止代码时,它根本不更新图像,或者在很久之后更新它。
这看起来好像Android并没有使视图失效,但是添加looks ()也于事无补。有什么想法吗?
以下是代码:
Picasso.with(getContext()).load(url).into(new Target() { // using Picasso to load the image
@Override public void on