Nick Ruiz
Nick Ruiz

Reputation: 1435

Send an Intent for the user to select a file on Android

Is there a default activity in Android that handles the opening of files? For example in Quickoffice, you can open a file, but it doesn't allow you to navigate directories. This might be an old-school type of request, but in an application I'm developing, I want to send an Intent to request the user to select a file. My application will then process that file.

Ideally, this will end up as a Settings configuration for a service that will be used by other applications.

Edit: I'm browsing the documentation at http://developer.android.com/guide/topics/data/data-storage.html, but in my case, I want to store and retrieve data that doesn't fit in any of the categories:

Upvotes: 2

Views: 4117

Answers (2)

Nacho L.
Nacho L.

Reputation: 9582

You could use a library like android-file-dialog, or build your own picker.

Upvotes: 3

CommonsWare
CommonsWare

Reputation: 1006604

Is there a default activity in Android that handles the opening of files?

For the types of files managed by MediaStore (e.g., MIME type audio/*), ACTION_PICK works. For arbitrary files, no.

Upvotes: 3

Related Questions