Question

I am building an app that needs to launch the android in-built file system app at the click of a button. I am not sure what to call it, it says "Documents" as its title and lists out all files present on the device. This is what it looks like -enter image description here

Was it helpful?

Solution

The image you have added is of Documents application. Android 4.4 (API level 19) introduces the Storage Access Framework (SAF). The SAF makes it simple for users to browse and open documents, images, and other files across all of their their preferred document storage providers.


You can lunch this application via ACTION_OPEN_DOCUMENT

// ACTION_OPEN_DOCUMENT is the intent to choose a file via the system's file
// browser.
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);

// Filter to only show results that can be "opened", such as a
// file (as opposed to a list of contacts or timezones)
intent.addCategory(Intent.CATEGORY_OPENABLE);

// Filter to show only images, using the image MIME data type.
// If one wanted to search for ogg vorbis files, the type would be "audio/ogg".
// To search for all documents available via installed storage providers,
// it would be "*/*".
intent.setType("image/*");

startActivityForResult(intent, READ_REQUEST_CODE);

Read more about Storage Access Framework.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top