Search code examples
androidandroid-volleypicasso

Can I use Volley with Picasso?


Say I have this method

String getURL(){}; // means return a string URL asynchronously 

getURL() uses Volley to request a JSON-object, and GSON parses the object for an image URL.

Could I do this with Picasso?

Picasso
    .with()
    .load(getURL())
    .placeholder()
    .into();

Will Picasso refresh the place-holder images with the actual images?


Solution

  • As you have known that Volley is asynchronous, so inside onResponse of Volley request, where you have succesfully get the Url of the image, you can use Picasso to load that Url into the ImageView.

    Hope this helps!