Pick a file
org.openintents.action.PICK_FILE
Pick a file through a file manager.
The picked file 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.
Use
public void startPickAFile(String title, String buttonText) { Intent intent = new Intent("org.openintents.action.PICK_FILE"); intent.setData(dataUri); // A file URI for suggested file name or starting directory. Can also be left empty. intent.putExtra("org.openintents.extra.TITLE", title); // String intent.putExtra("org.openintents.extra.BUTTON_TEXT", buttonText); // String if (intent.resolveActivity(getPackageManager()) != null) { startActivityForResult(intent, REQUEST_CODE); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { // handle result } }
Example intent filter
<activity ...> <intent-filter> <action android:name="org.openintents.action.PICK_FILE" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
Apps Providing an Implementation
Search on Google Play, AppBrain, Amazon App store or similar (not yet available - please make this happen!)