Reputation: 1336
I am implementing a custom DocumentsProvider. When accessing the file picker using standard Android protocol, the application can provide multiple mime types they are interested in, then request the file picker doing something like this:
// Use the media type they selected
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setType( "*/*");
startActivityForResult(intent, SELECT_MEDIA_CODE);
When the file picker opens, my custom document provider is shown. What I need to do in that class is be able to detect what the list of mime types was that the app stored in the 'putExtra' line above, so I can load the cursor appropriately in the document providers 'queryChildDocuments' method.
How do I get at the data in the intent that was used to launch the File Picker from within the DocumentsProvider?
Upvotes: 2
Views: 204
Reputation: 199880
That's not possible - you should just return all of the files you have.
The mime types provided to the file picker are used for two purposes:
Upvotes: 1