iPaulPro / aFileChooser

[DEPRECATED] Android library that provides a file explorer to let users select files on external storage.
Apache License 2.0
1.79k stars 850 forks source link

is it possible to set default folder in afilechooser? #86

Open saeedadeli opened 7 years ago

saeedadeli commented 7 years ago

I want to set a folder in internal memory to open on that folder when user select "choose file" icon. I also, do as bellow but it does not work:

Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("text/plain"); Uri startDir = Uri.fromFile(new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/myfolder"));

    intent.setDataAndType(startDir,
            "vnd.android.cursor.dir/lysesoft.andexplorer.file");
    intent.addCategory(Intent.CATEGORY_OPENABLE);

    ActivityForResult(
                Intent.createChooser(intent,getString(R.string.choose_file)),
                FILE_SELECT_CODE);