Material file picker for Android
Switch branches/tags
Nothing to show
Clone or download
dimorinny Merge pull request #88 from prscX/master
 Added Support for React Native Projects
Latest commit aa706ea Apr 15, 2018

Material File Picker Android Arsenal

Material file picker library for Android


Add repository url and dependency in application module gradle file:

repositories {
    maven {
        url  "" 

dependencies {
    compile 'com.nbsp:library:1.8'

Open file picker:

new MaterialFilePicker()
    .withFilter(Pattern.compile(".*\\.txt$")) // Filtering files and directories by file name using regexp
    .withFilterDirectories(true) // Set directories filterable (false by default)
    .withHiddenFiles(true) // Show hidden files and folders


Intent intent = new Intent(this, FilePickerActivity.class);
intent.putExtra(FilePickerActivity.ARG_FILE_FILTER, Pattern.compile(".*\\.txt$"));
intent.putExtra(FilePickerActivity.ARG_DIRECTORIES_FILTER, true);
intent.putExtra(FilePickerActivity.ARG_SHOW_HIDDEN, true);
startActivityForResult(intent, 1);

Override on activity result:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == 1 && resultCode == RESULT_OK) {
        String filePath = data.getStringExtra(FilePickerActivity.RESULT_FILE_PATH);
        // Do anything with file

Runtime permissions:

You should handle runtime permissions in activity, from what you called Material File Picker. Look here for example code.

Third Party Bindings

React Native

You may now use this library with React Native via the module here