I have an activity in my app that allows the user to select several files from the device one by one, I am using an intent like this:
Intent intent = new Int
Make sure you're using the ContentResolver from the Activity that requested the content, for instance:
activity.getContentResolver()
Instead of MyApp.getContext().getContentResolver()
It was apparently the case for me and it didn't need to add the android.permission.MANAGE_DOCUMENTS to the manifest.
And that you call the intent using this:
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
intent.setAction(Intent.ACTION_GET_CONTENT);
} else {
intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
}
more info: https://developer.android.com/guide/topics/providers/document-provider.html#client