问题
so this recently broke for me (not sure if it has to do with the Facebook scandal). But, now I cant load the image url I get back from the facebook login api into glide.
Here's my code.
private void useFacebookButton()
{
facebookButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult)
{
Profile profile = Profile.getCurrentProfile();
playerID = profile.getId();
firstName = profile.getFirstName();
lastName = profile.getLastName();
profileImage = profile.getProfilePictureUri(500,500).toString();
Glide.with(getActivity().getBaseContext()).load(profileImage).centerCrop().into(someImageView);
}
@Override
public void onCancel()
{
}
@Override
public void onError(FacebookException error)
{
Log.d(TAG,"facebook error :(");
Log.d(TAG,error.getMessage());
}
});
}
I get a url that comes back as https://graph.facebook.com/<facebookID>/picture?height=500&width=500&migration_overrides=%7Boctober_2012%3Atrue%7D
But glide cannot load that anymore. When I pop it into chrome it doesnt display the image, but forces a download now. And when i download its the correct image. This has just recently happened, it was working fine last week. Dont know if anyone has found a way to fix to this?!?
来源:https://stackoverflow.com/questions/49517345/android-facebook-image-not-loading-in-glide