最近,Google Play 游戏更新了他们的服务,无需 Google+ 帐户即可运行,而是玩家创建自己的昵称,并选择个人资料图片。
我究竟如何加载此个人资料图片以显示它?
之前我用过getIconImageUri()
of Player
-class 显示 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)
你必须使用图像管理器现在,由于图像存储在设备本地。
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());
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)