我如何解决Google Play游戏服务:SecurityException:权限拒绝:打开提供商?

时间:2013-12-10 03:59:05

标签: java android google-play google-play-services

我输入了这样的权限错误:

12-10 11:40:16.299: E/AndroidRuntime(1418): java.lang.SecurityException: Permission Denial: opening provider com.google.android.gms.games.provider.GamesContentProvider from ProcessRecord{437fc7e8 1418:com.papa.games.bc/u0a276} (pid=1418, uid=10276) that is not exported from uid 10020

我的代码就像这样

Bitmap bm = null;
try {
    bm = MediaStore.Images.Media.getBitmap(this.getContentResolver(), getGamesClient().getCurrentPlayer().getIconImageUri());
} catch (FileNotFoundException e) {
    Log.i("TAG", "FileNotFoundException", e);
} catch (IOException e) {
    Log.i("TAG", "IOException", e);
}

如何解决这个问题?

1 个答案:

答案 0 :(得分:3)

您必须使用其中一种ImageManager方法从Google Play服务中加载图片。这些处理缓存和加载 - 您只需要显示返回的Drawable或使用loadImage(imageView, uri)直接加载到ImageView