Android Picasso Image Does Not Load
There are two situations I load images, first, just directly from the internet, and second, load images that are downloaded in the device. And whenever I load, 8~9 out of 10 images
Solution 1:
You can turn on Picasso logs using Picasso.with(Context).setLoggingEnabled(true)
. You will probably see an error message with a reason there.
It's also worth logging the URL you are using and trying it a browser, just in case.
Solution 2:
Solution 3:
Try to replace "http:" at the start of your Url with "https:" (if it applies)
(on your String representation of Url).replace("http:", "https:");
Works for me.
Solution 4:
In Picasso you shoud pass url in .load()
method to load picture from internet and object of File
type to load picture from device storage.
So if the picture is stored on device load it like this:
Picasso.with(activity)
.load(new File(path))
.placeholder(R.drawable.thumbnail_placeholder)
.resize(width,height)
.into(imageView);
And use this code to load picture from internet:
Picasso.with(activity)
.load(path)
.placeholder(R.drawable.thumbnail_placeholder)
.resize(width,height)
.into(imageView);
Solution 5:
Don't know its relevant to this issue or not but my problem is solved by using Glide instead of Picasso.
Post a Comment for "Android Picasso Image Does Not Load"