Pick directory

Action: 
org.openintents.action.PICK_DIRECTORY
Input: 
A file URI for suggested starting directory. Can also be left empty.
Intent Extra: 
Button text
Intent Extra: 
Title
Output: 
File URI of the selected directory.

Pick a directory (folder) through a file manager.

Sample usage:

Intent intent = new Intent("org.openintents.action.PICK_DIRECTORY");
intent.setData(Uri.parseUri("file:///sdcard"));
intent.putExtra("org.openintents.extra.TITLE", "Please select a folder");
intent.putExtra("org.openintents.extra.BUTTON_TEXT", "Use this folder");
startActivityForResult(intent, 1);

The picked directory URI can be obtained in onActivityResult() through getData().

Details can be found in the sample application TestFileManager in the public repository.

You may want to use the OI File Manager intent definition file.

Comments

regarding PICK_DIRECTORY intent

Hi Peli,

Where is this org.openintents.action.PICK_DIRECTORY intent is written??

Action string

It is just a string that you can define and use as the action. You can also copy the FileManagerIntents class from the OI File Manager source code into your application and use the static String constants defined there.

regarding PICK_FILE intent

Peli,
First of sorry to post comment of the PICK_FILE here due to no comment option is available in the PICK_FILE section.

To open a file stored in the sdcard i used following code,

first I have added follwing ACTION string variable,
public static final String ACTION_PICK_FILE = "org.openintents.action.PICK_FILE";

then I used follwing code in the onclick() function

Intent myIntent = new Intent(ACTION_PICK_FILE,Uri.parse("file://"+ file.getAbsolutePath()));
startActivity(myIntent);

but it shows error in opening file.

I also added follwing in the manifest.xml.

but still no improvemnet in the result.
Please help. Thanks in advance.

Move to developer forum

Please move this detail question to the developer forum. Write in detail what the error message is (is it a toast, or is it in logcat?). Have you tried the TestFileManager sample application? Does that work for you? Please reply in the developer forum.

Applications providing Pick directory

Titlesort icon Provides intent actions Provides intent URIs Uses action Uses URI Description
Blackmoon File Browser

Blackmoon File Browser is a file manager similar to OI File Manager.
Features:

  • Browse, open, rename, manage, copy, move, delete or even email files found on your phone. Aware of 100+ registered file extensions.
  • Multiple file selection support.
  • Attach files to email.
  • View thumbnails of image files.
  • Create music playlists with the Send Marked feature.
  • Pack/unpack Zip files.
  • Create Jump Points to any file or folder both in the app and on the Home screen.
OI File Manager File URI

OpenIntents File Manager

Applications using Pick directory

Titlesort icon Provides intent actions Provides intent URIs Uses action Uses URI Description
Blackmoon AttachSave Pick directory

Small app that will save email attachments to the SD card when the attachment is previewed/opened from the built-in Gmail or Email app.

Blackmoon File Browser

Blackmoon File Browser is a file manager similar to OI File Manager.
Features:

  • Browse, open, rename, manage, copy, move, delete or even email files found on your phone. Aware of 100+ registered file extensions.
  • Multiple file selection support.
  • Attach files to email.
  • View thumbnails of image files.
  • Create music playlists with the Send Marked feature.
  • Pack/unpack Zip files.
  • Create Jump Points to any file or folder both in the app and on the Home screen.
Wallpaper Label Set wallpaper Pick directory

Add a label to each home screen.