![](/img/trans.png)
[英]How to solve SecurityException: Permission Denial error on API 23 (Marshmallow)?
[英]How I solve Google Play Game Services: SecurityException: Permission Denial: opening provider?
我遇到了這樣的權限錯誤:
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);
}
我該如何解決這個問題?
您必須使用ImageManager方法之一才能從Google Play服務加載圖像。 這些為您處理緩存和加載-您只需要顯示返回的Drawable
或使用loadImage(imageView, uri)
直接加載到ImageView
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.