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_TYPESandsetType(String)to */*.
本文介绍如何使用Android Intent来实现特定类型的文件选择器,通过设置Intent的类型和额外的MIME类型参数来限定可选文件的范围。
2382

被折叠的 条评论
为什么被折叠?



