https://developer.android.com/reference/android/content/Intent.html#ACTION_OPEN_DOCUMENT
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent .setType("*/*");
String[] mimeTypes = {"image/*", "application/pdf"};
intent .putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
Callers must indicate the acceptable document MIME types throughsetType(String)
. For example, to select photos, useimage/*
. If multiple disjoint MIME types are acceptable, define them inEXTRA_MIME_TYPES
andsetType(String)
to */*.