0

when I use my own Target to put the Bitmap loaded by Picasso into my ImageView like this (I do that because I want to compress the bitmap to a byte array to store it in sqlite):

private ImageView imageView;
.
.
.

Picasso.with(getContext()).load(uri).into(target);

private Target target=new Target()
{
    @Override
    public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from)
    {
        imageView.setImageDrawable(new BitmapDrawable(getContext().getResources(), bitmap));
    }

    @Override
    public void onBitmapFailed(Drawable errorDrawable)
    {
    }

    @Override
    public void onPrepareLoad(Drawable placeHolderDrawable)
    {
    }
};

I do that in the getView method of my ArrayAdapter, which serves a GridView. it is very slow (without compressing yet), showing the pics in the final gridview only bit by bit, in contrast to putting it directly into the imageview. why is that? how can I combine fast Picasso loading with retrieving the bytes of every loaded pic?

Lemao1981
  • 2,225
  • 5
  • 18
  • 30

1 Answers1

0

use this code may be its help you

Picasso.with(this).load("http://api.androidhive.info/json/movies/1.jpg").placeholder(getResources().getDrawable(R.drawable.ic_launcher)).into(imageViewCenter);
Nitesh Pareek
  • 362
  • 2
  • 10