Java - How to pick multiple files in Android
<p>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.</p>

<pre><code>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);
</code></pre>

<p>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.</p>

<pre><code>Intent intent = new Intent();
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, PICKFILE_REQUEST_CODE);
</code></pre>

<p>I’ve tried also other combinations, but often an error similar to this appears:</p>

<pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.GET_CONTENT (has extras) }
</code></pre>

<p>How can I select multiple files, possibly in a way alike to first method?</p>