i´m using Picasso and Target for downloading an image and saving it as a bitmap to pass it into an Object which i use for and RecyclerView.
But when I try to download the image the Target also loads the onBitmapFailed
or onPrepareLoad
and the bitmap
is not successfully received...
where´s the bug in my code? The URL is absolutely correct. when i take the passed URL and paste it in chrome browser the image shows...
Code
//Get Bitmap
targetForBitmap = new Target() {
@Override
public void onBitmapLoaded (final Bitmap responseBitmap, Picasso.LoadedFrom from){
bitmap = responseBitmap;
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
Log.i("prepareLoad", "onPrepereLoad ääääääääääääääääääää ");
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
Log.i("onBitmapFailed", "onBitmapFailed xxxxxxxxxxxxxxxx");
}
};
String url = "Http://" + server_wan + ":" + port_wan + "/" + server_path + "/Produktbilder/" + product_image + ".png";
Log.i("url", url);
Picasso.with(SpeisekarteActivity.this)
.load(url)
.into(targetForBitmap);
targetForBitmap is string instance at beginning of the class (private Target targetForBitmap
)