-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Picasso Not Loading HTTPS Facebook Links #1658
Comments
Are you holding a reference to your Target anywhere non-locally? Picasso only holds weak references to Targets, so it looks like it's getting garbage collected here. |
No I'm not. This code is all inside a method. Should I declare Target as global property to hold an instance outside the method instead? |
Hold a reference to it for as long as your userPicture is around (like a field in the controller class). Typically, custom Views implement the Target interface. |
Humm... I will do it now. Give me 1 minute. |
It worked!! Just perfectly! So my mistake was creating the Target as a local method property then when Picasso took a little bit more time to load the image maybe the Garbage Collector cleaned the Target reference which was make it impossible to Picasso to load it into the Target. That is why it SOMETIMES worked. |
Hi there,
Before you set the question/issue as duplicate, please read it all first.
I know it is a known issue and there's loads of question on Stackoverflow and issues on Github but believe me I tried them all.
ISSUE
Not loading this link:
MY CODE
WHAT I HAVE TRIED
NO CACHE:
Picasso.with(getContext()).load(me.getPicture().getUrl()).memoryPolicy(MemoryPolicy.NO_CACHE).networkPolicy(NetworkPolicy.NO_CACHE).into(target);
NEW DOWNLOADER:
new Picasso.Builder(getContext()).downloader(new OkHttpDownloader(getContext())).build().load(me.getPicture().getUrl()).into(target);
BOTH:
new Picasso.Builder(getContext()).downloader(new OkHttpDownloader(getContext())).build().load(me.getPicture().getUrl()).memoryPolicy(MemoryPolicy.NO_CACHE).networkPolicy(NetworkPolicy.NO_CACHE).into(target);
What am I doing wrong?
The text was updated successfully, but these errors were encountered: