我有问题获取位图使用Picasso for for循环.
在第一次运行时不会调用onBitmapLoaded .
第二次打它叫
for (int i = 0; i < 3; i++) {
final int k=i;
Picasso.with(this)
.load(ListA.get(i).getImage()) //image
.resize(100, 100)
.transform(new ImageTrans_CircleTransform())
.into(new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
Log.i("load", "Ok " + k);
//use bitmap for add marker to map
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
Log.i("load", "first " + k);
}
});
}
Run Code Online (Sandbox Code Playgroud)
日志
11-04 16:42:22.222 11677-11677/com.tenten I/load? first___0 …Run Code Online (Sandbox Code Playgroud)