【问题标题】:Google Play Games and Profile PicturesGoogle Play 游戏和个人资料图片
【发布时间】:2016-06-17 11:56:12
【问题描述】:

最近,Google Play Games 更新了他们的服务,无需 Google+ 帐户即可使用,而是让玩家创建自己的昵称并选择个人资料图片。

我如何才能加载此个人资料图片以显示它?

之前,我使用Player-class 中的getIconImageUri() 来显示Google+ 个人资料图片,但现在它只是抛出了一些奇怪的异常。

这是异常的一个片段:

03-04 17:04:57.399 5076-5543/? W/System.err: java.lang.SecurityException: Permission Denial: opening provider com.google.android.gms.games.chimera.GamesContentProviderProxy from ProcessRecord{42f038e8 9143:com.mygame.test/u0a132} (pid=9143, uid=10132) that is not exported from uid 10013
03-04 17:04:57.425 9143-9164/? W/ImageView: Unable to open content: content://com.google.android.gms.games.background/images/85348a8/343
                                            java.lang.SecurityException: Permission Denial: opening provider com.google.android.gms.games.chimera.GamesContentProviderProxy from ProcessRecord{42f038e8 9143:com.mygame.test/u0a132} (pid=9143, uid=10132) that is not exported from uid 10013
                                                at android.os.Parcel.readException(Parcel.java:1472)
                                                at android.os.Parcel.readException(Parcel.java:1426)

【问题讨论】:

  • 能否提供抛出异常的日志?
  • @adjuremods 好了。

标签: android google-play-games


【解决方案1】:

您现在必须使用ImageManager,因为图像本地存储在设备上。

public void showPlayerImage(int imgViewId) {
    ImageView image = (ImageView) findViewById(imgViewId);

    Player me = Games.Players.getCurrentPlayer(mGoogleApiClient);

    ImageManager mgr = ImageManager.create(this);
    mgr.loadImage(image, me.getIconImageUri());
}

【讨论】:

  • 谢谢。像魅力一样工作。
  • 它的工作,但下次我打开应用程序它不会显示。
猜你喜欢
  • 2013-09-02
  • 2016-08-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-25
  • 2014-09-17
  • 2014-09-17
  • 1970-01-01
相关资源
最近更新 更多