在我的应用程序中,我有一个列表,其中包含从standart android(lollipop)filepicker中选择的图像.每个图像都有URI,例如content://com.android.providers.media.documents/document/image:105628.
图像选择代码:
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
startActivityForResult(intent, SELECT_IMAGE_ACTIVITY_REQUEST_CODE);
在调用ACTION_VIEW的列表中单击图像.并查看应用程序崩溃异常.
图片查看代码:
Intent viewIntent = new Intent(Intent.ACTION_VIEW);
viewIntent.setDataAndType(finalPhoto, "image/*");
startActivity(viewIntent);
例外:
java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider from ProcessRecord{247dd26c 18416:com.google.android.apps.plus/u0a51} (pid=18416, uid=10051) requires android.permission.MANAGE_DOCUMENTS or and