我已经在这个论坛上看到过所有贴子,但是我还没有找到任何东西。 如何在ImageView中显示Google加上登录我的应用的人的个人资料图片?与ImageManager? 请问您能显示一些代码吗?Google Plus个人资料图片Google Play游戏服务
0
A
回答
1
下面的方法做你想做的。
public class AvatarImage extends ImageView {
Bitmap image;
public static final String TAG = "AvatarImage";
public AvatarImage(Context context) {
super(context);
setImageResource(R.drawable.avatar);
}
/**
* This method takes the participant object and attempts to
* download avatar of the participant from google plus
* if this is unsuccesful default avatar is shown
* @param p
*/
public void setImageFromParticipant(Participant p) {
ImageManager im = ImageManager.create(getContext());
im.loadImage(this, p.getIconImageUri(), R.drawable.avatar);
try{
Bitmap bitmap = ((BitmapDrawable)this.getDrawable()).getBitmap();
setImageBitmap(bitmap);
}
catch(NullPointerException e)
{
e.printStackTrace();
}
}
}
0
如从约翰对方的回答中的代码是正确的,但是,目前与谷歌Play业务图书馆这里Google Issue Tracker所示为使用版本库中的10人(或许版本9的问题。 。版本8很好)。不幸的是,对于这个问题,如果您甚至尝试获取由ImageManager解码的URI,Google Play服务将停止工作。要么等待图书馆的下一个版本,要么尝试获取版本8的版本号。 (我无法将此作为对上述答案的评论,因此不得不用新的答案...)
相关问题
- 1. Android Google Play游戏服务
- 2. Google Play游戏服务
- 3. Google Play游戏服务多人游戏iOS和Android
- 4. Google Play游戏服务实时多人游戏
- 5. 如何从Google Plus获取大型个人资料图片?
- 6. libGDX Google Play游戏服务 - Android
- 7. AndEngine with Google Play游戏服务
- 8. Google Play游戏服务和AdMob
- 9. Google Play游戏服务注销回调
- 10. Google Play游戏服务登录问题
- 11. Google Play游戏服务在中国?
- 12. Google Play游戏服务BaseGameUtils错误
- 13. Google Play游戏服务无法启动。
- 14. Google play游戏服务 - 成就点
- 15. Google Play游戏服务+模拟器
- 16. Unity3d Prime31 Google Play游戏服务教程
- 17. Android Google Play游戏服务startQuickGame,undefined makeBasicRoomConfigBuilder()
- 18. Google Play游戏服务成就加载
- 19. Google Play游戏服务createAutoMatchCriteria MIN_OPPONENTS> 1
- 20. sendReliableMessage自己? Google Play游戏服务 - Android
- 21. 设置Google Play游戏服务
- 22. 使用一个帐户测试Google Play游戏服务多人游戏
- 23. 如何使用Google Play游戏服务在RealTimeMultiplayer中获取参与者的个人资料图像
- 24. 是否可以解析Google+(Google Plus)个人资料页面?
- 25. 我可以在Google+游戏服务中将其Google+个人资料显示给其他人吗?
- 26. 在Android游戏中配置不当的Google Play游戏服务
- 27. Google Play游戏服务可用于非游戏
- 28. 登录Google Play游戏服务后游戏崩溃
- 29. Google Play游戏服务 - 使用AutoMatch的玩家人数最多
- 30. 允许多人登录Google Play游戏服务?
不工作这个代码!你有其他解决方案吗? – John95
对不起。这非常简单,适用于我。如果您在将代码集成到代码时遇到问题,您应该更具体地了解它如何工作。所以我可以帮忙。 – user2259824
当我写ImageHelper时出错。我该怎么办? – John95