picassoを使用してログインしたユーザーのプロフィール画像を表示するようにアプリを取得しようとしていますが、profile.getPhotoUrl()
の方法で生成されたURLがプロフィール画像に表示されませんが、表示されない画像を表示します。
私はいくつかの調査を行い、なぜそれが表示されないのかは、それがcontentProvider uriであることに気づきました。
プロフィール画像を表示するにはどうすればよいですか?picassoを使用してURIの画像を表示するにはどうすればよいですか?画像が表示されない
Hereは、プロファイルのURIはどのようなものになるかです:
if (user != null) {
for (UserInfo profile : user.getProviderData()) {
// Id of the provider (ex: google.com)
String providerId = profile.getProviderId();
// this displays the email for some reason
String uid = profile.getUid();
//displays the name
String name = profile.getDisplayName();
//doesnt even display the email for some reason
String email = profile.getEmail();
//profile pic uri
Uri photoUrl = profile.getPhotoUrl();
displayUser.setText(uid);
displayName.setText(name);
displayPhotoUrl.setText(photoUrl.toString());
Picasso.with(getApplicationContext())
.load(photoUrl)
.into(pic);
};
}
これは、古いイメージを新しいイメージで置き換え続けます。あなたは毎回同じ画像のImageViewを使用しています。 –
'callback'を使用して問題が' Picasso'であった場合にエラーを見てください – MHSFisher