I want to use the android system dialog provided as part of the Storage Access Framework to open a file. I do this with
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("application/pdf");
startActivityForResult(intent, EDIT_REQUEST);
and then handle the returned URI in onActivityResult()
.
The problem is that, in the resulting menu, I get far less content providers than I expected. Only Google Drive and Downloads (see left screen shot below). Others, like Dropbox, Solid Explorer,... are not show.
I suspect the reason is that these apps simply don't set the necessary intent filter to show up in this list.
However, other apps, for example Kaiten Mail or Chrome, somehow manage to show the system dialog with fully implemented content providers at the top of the list and then others, like Dropbox and Solid Explorer, below, separated by a thin bar (see the right screen shot).
How can I get this behavior?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…