I am having the same problem, that I want to use the drawables that are generated by the Picasso for Image Caching Purpose, but I am not able to get the same. Here is the code which I am using to access the Bitmap Drawables :
Target targetBitmap = new Target() { @Override public void onPrepareLoad(Drawable arg0) { } @Override public void onBitmapLoaded(Bitmap arg0, Picasso.LoadedFrom arg1) { mBitmap = arg0; BitmapDrawable d = new BitmapDrawable(context.getResources(), arg0); int margin = 2; int border = 0; Rect r = new Rect(margin, margin, width - margin, height - margin); int imageWidth = r.width(); int imageHeight = r.height(); if (imageHeight > r.height() - (border * 2)) { imageHeight = r.height() - (border * 2); } r.left += ((r.width() - imageWidth) / 2) - border; r.right = r.left + imageWidth + border + border; r.top += ((r.height() - imageHeight) / 2) + border; r.bottom = r.top + imageHeight + border + border; Paint p = new Paint(); p.setColor(0xFFFFFF); c.drawRect(r, p); r.left += border; r.right -= border; r.top += border; r.bottom -= border; d.setBounds(r); d.draw(c); } @Override public void onBitmapFailed(Drawable arg0) { } }; Picasso.with(context).load(app.getListBookDetails().get(img_num).getImage_150x225()).into(targetBitmap);
But here onBitmapLoaded method is never called. How can I access this method ? Please help if you can. I have scratched everything but has gone all in vain.
Thanks Sanat