Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folders are not showing up #130

Open
abdalmoniem opened this issue May 9, 2020 · 1 comment
Open

Folders are not showing up #130

abdalmoniem opened this issue May 9, 2020 · 1 comment

Comments

@abdalmoniem
Copy link

Hello,

I'm using the below code to show directories:

Log.d("mn3m", "Internal SD Card Path: " + StorageUtils.getAllStorageLocations().get("sdCard").getAbsolutePath());

Intent chooserIntent = new Intent(this, DirectoryChooserActivity.class);

DirectoryChooserConfig config = DirectoryChooserConfig.builder()
                                .newDirectoryName("DialogSample")
                                .allowNewDirectoryNameModification(true)
                                .allowReadOnlyDirectory(true) 
                                .initialDirectory(StorageUtils.getAllStorageLocations()
                                                              .get("sdCard").getAbsolutePath())
                                .build();

chooserIntent.putExtra(DirectoryChooserActivity.EXTRA_CONFIG, config);

// REQUEST_DIRECTORY is a constant integer to identify the request, e.g. 0
(chooserIntent, 10);

the output of this log is:

2020-05-09 21:50:56.546 13600-13600/pct.droid.dev D/mn3m: Internal SD Card Path: /storage/emulated/0

when I use the above code, I get a new activity with EMPTY view, no directories are shown, I'm using android 10 on a OnePlus 6T device, permissions are granted and DialogChooserActivity is added in AndroidManifest.xml

@gstraymond
Copy link

Have the same problem, seems related to scoped storage introduced in Android 10 and enabled in Android 11
https://medium.com/androiddevelopers/android-11-storage-faq-78cefea52b7c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants