[英]How to get google account profile picture in android app
Iam using firebase google sign in in my project.我在我的项目中使用 firebase google 登录。 I want to display the account name, email and profile picture.我想显示帐户名称 email 和个人资料图片。 I can display the name and email without any problem but i can't able to display the users google account profile picture.我可以毫无问题地显示名称和 email,但我无法显示用户的谷歌帐户个人资料图片。 How do i do that.我怎么做。
GoogleSignInAccount acct = GoogleSignIn.getLastSignedInAccount(getActivity());
if (acct != null) {
String personName = acct.getDisplayName();
String personEmail = acct.getEmail();
Uri personPhoto = acct.getPhotoUrl(); // this line to get profile picture
}
then you can use Picasso Library to show images in ImageView然后您可以使用毕加索库在 ImageView 中显示图像
Picasso.with(this).load(personPhoto).into(R.id.imageview);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.