Is there a way to use intent.setType()
and supply multiple broad types (like images and video)?
I am using an ACTION_GET_CONTENT
. It seems to be working with just comma-separated types.
In Android 4.4 when using the Storage Access Framework you can use the EXTRA_MIME_TYPES
to pass multiple mime types.
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
String[] mimetypes = {"image/*", "video/*"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
startActivityForResult(intent, REQUEST_CODE_OPEN);