I've got an issue with onBitmapLoaded
. The method is not called when it should be (it is called the second time i enter my view). Nevertheless i keep a reference to my target since i add it to an arraylist
.
I don't understand why it's not working. Does someone have an idea ?
public void loadBitmap() {
if(loadtarget == null) {
loadtarget = new Target(){
@Override
public void onPrepareLoad(Drawable arg0) {
Log.d("Bitmap","On prepare load");
targetList.remove(this);
return;
}
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
Log.d("Bitmap","OKAY for :" + filename);
targetList.remove(this);
handleLoadedBitmap(bitmap);
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
Log.d("Bitmap","Error for :" + filename);
}
};
}
targetList.add(loadtarget);
Picasso.with(context).load(imageUrl).into(loadtarget);
}