BHFileBrowser is a simple file chooser for Android applications that uses FontAwesome icons. There are several configurable options, such as file extension filtering, displaying hidden files, and whether directories or files can be selected.
Add the following line to your build.gradle file.
dependencies {
compile 'com.beardedhen:bhfilebrowser:+'
}
You can either use a FileBrowserActivity:
Intent intent = new Intent(MainActivity.this, FileBrowserActivity.class);
intent.putExtra(Actions.FB_START_DIR, "/");
intent.putExtra(Actions.FB_SHOW_HIDDEN_FILES, true);
intent.putExtra(Actions.FB_SELECT_MODE, SelectMode.DIR);
intent.putExtra(Actions.FB_FILE_EXTENSIONS, filterExtension);
intent.putExtra(Actions.FB_BROWSER_TITLE, "Pick any file");
startActivityForResult(intent, REQUEST_CODE);
Or a FileBrowserDialog:
ArrayList<String> filterExtension = new ArrayList<>();
filterExtension.add("apk");
Bundle bundle = new Bundle();
bundle.putString(Actions.FB_START_DIR, "/");
bundle.putBoolean(Actions.FB_SHOW_HIDDEN_FILES, true);
bundle.putSerializable(Actions.FB_SELECT_MODE, SelectMode.FILE);
bundle.putStringArrayList(Actions.FB_FILE_EXTENSIONS, filterExtension);
bundle.putString(Actions.FB_BROWSER_TITLE, "Custom File Dialog");
dialog = FileBrowserDialog.newInstance(bundle, MainActivity.this);
dialog.show(getSupportFragmentManager(), null);
If you discover a bug/enhancement or just have a question, please create a ticket in the issue tracker. Be sure to include reproduction steps and if relevant Android version/model.