I've modified your code a little bit to be able to specify an initial root path for aFileChooser, by adding the PATH string extra to the intent that starts the FileChooserActivity. I think it may be useful for others. Thank you for the excellent work you've done. Now with little effort I have a very good file picker in my App.
Example usage:
private static final int FILE_CHOOSER = 1234;
Intent chooseFile = new Intent(context, FileChooserActivity.class);
chooseFile.putExtra(FileChooserActivity.PATH, "/your/custom/root/path");
startActivityForResult(chooseFile, FILE_CHOOSER);
I've modified your code a little bit to be able to specify an initial root path for aFileChooser, by adding the PATH string extra to the intent that starts the FileChooserActivity. I think it may be useful for others. Thank you for the excellent work you've done. Now with little effort I have a very good file picker in my App.
Example usage: private static final int FILE_CHOOSER = 1234;
Intent chooseFile = new Intent(context, FileChooserActivity.class); chooseFile.putExtra(FileChooserActivity.PATH, "/your/custom/root/path"); startActivityForResult(chooseFile, FILE_CHOOSER);