I have problem with get bitmap use Picasso in for loop.
it is not called onBitmapLoaded in first run.
second run it called
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);
}
});
}
Log
11-04 16:42:22.222 11677-11677/com.tenten I/load﹕ first___0
11-04 16:42:22.222 11677-11677/com.tenten I/load﹕ first___1
11-04 16:42:22.232 11677-11677/com.tenten I/load﹕ first___2
I use picasso to get bitmap from list image.
I need bitmap not imageview.
Thank you. :D
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…