Picasso Loads the image fine if its from a https url like: https://i.ytimg.com/vi/28uUsJ72a1A/hqdefault.jpg
Since youtube directs all traffic through https this works to:
http://i.ytimg.com/vi/28uUsJ72a1A/hqdefault.jpg
But when I use my url
http://www.example.com/images/djnsdfndsf.jpg
it redircets the link to a https version of the site and just gives a error
This is how i'm loading the images
Picasso.with(this).load(current.getImageURL()).into(ImageView);
So I tried using this:
//Below code for Picasso initializing once for the app
private Picasso picasso;
private OkHttpClient okHttpClient;
okHttpClient = new OkHttpClient();
picasso = new Picasso.Builder(this)
.downloader(new OkHttpDownloader(okHttpClient))
.build();
//Below code to retrieve the images whereever required on the app
picasso.with(this).load(current.getImageURL()).into(imageView)
But Above code gives cannot resolve OkHttpDownloader
Right Now I'm using compile 'com.squareup.picasso:picasso:2.5.2'
EDIT
How do I force Picasso to download it over http not https?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…