I’m doing an application for Android (version 4.4), and I’m trying to select multiple files (.doc, .pdf) at the same time. The objective is to navigate through directories, select some desiderated files and return a list of these files. I’ve initially tried in this way, but the instruction Extra_Allow_Multiple doesn’t work: I can only select one file at a time.
Intent intent = new Intent("com.sec.android.app.myfiles.PICK_DATA");
intent.putExtra("CONTENT_TYPE", "*/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.addCategory(Intent.CATEGORY_DEFAULT);
startActivityForResult(intent, PICKFILE_REQUEST_CODE);
So I’ve tried in this other way, but I’m not browsing in all directories of the device, only in specific ones (images/videos/audio…), and I can’t select multiple files for the same reason as before.
Intent intent = new Intent();
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, PICKFILE_REQUEST_CODE);
I’ve tried also other combinations, but often an error similar to this appears:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.GET_CONTENT (has extras) }
How can I select multiple files, possibly in a way alike to first method?