Derzeit versuche ich, bestimmten Dateityp von SD-Karte oder mit irgendeiner Anwendung zu wählen, aber ich scheiterte, mein Code ist wie folgt,Wählen Sie docx, doc, rtf, pdf Art der Datei von der SD-Karte oder mit irgendeiner Anwendung in Android
Intent intent;
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT)
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
else
intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("application/pdf|application/msword|application/vnd.openxmlformats-officedocument.wordprocessingml.document" +
"|application/vnd.openxmlformats-officedocument.wordprocessingml.template" +
"|application/vnd.ms-word.document.macroEnabled.12" +
"|application/vnd.ms-word.template.macroEnabled.12" +
"!application/vnd.ms-word.template.macroEnabled.12|application/rtf");
startActivityForResult(intent, Constants.ImagePicker.REQ_PICK_RESUME);
aber es wählen Sie einfach jeden Dateityp aus.
möglich Duplikat https://stackoverflow.com/questions/33117592/how-to-pick-few-type-of-file-via-intent-in-android – k3b
Mögliche Duplikate von [Wie man einige Arten von Dateien über Intent in Android auswählen?] (Https://stackoverflow.com/questions/33117592/how-to-pick-few-type-of-file-via-intent-in- -android) – k3b