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

[BUG] SD Card not appearing in overview dialog on Android 11 #134

Open
mendhak opened this issue Sep 20, 2021 · 2 comments
Open

[BUG] SD Card not appearing in overview dialog on Android 11 #134

mendhak opened this issue Sep 20, 2021 · 2 comments
Assignees
Labels

Comments

@mendhak
Copy link

mendhak commented Sep 20, 2021

Describe the bug
When using the patched version of the library here, I've noticed that the storage choosing dialog doesn't show the SD card, it will just show the Internal Storage.

I've even given the app the MANAGE_EXTERNAL_STORAGE permission.
It works fine on Android 29, the SD card appears.

Has anyone found a way around this, or do they know what's missing?

To Reproduce
Use the patched version of the library here.
Create an emulator for Android API level 30, ensure that it has an SD card
Open the storage chooser.
Only 'internal storage' appears.

Expected behavior
SD card should also appear

Screenshots
image

Smartphone (please complete the following information):

  • Device: Emulator
  • OS: Android 11
@mendhak
Copy link
Author

mendhak commented Sep 20, 2021

From what I can tell, this line

only gets the /storage/emulated/... path in Android 11+, but it also gets the SD card path in Android 10 and lower. I just don't know why.

@mendhak
Copy link
Author

mendhak commented Sep 20, 2021

I've got this working in my fork of this repo, so the SD card appears on Android 11+ now.
Added in some additional fixes too:

  • Generic file icon for unknown file types
  • Use folder icon only for folders
  • Detect SD Card on Android 11
  • Fix for crash on Android 11

If anyone wants to use it as well,

implementation 'com.github.mendhak:storage-chooser:2.0.4.4b'

I'm checking for the SD card by parsing the getExternalFilesDirs output, because the /storage path is more restricted in Android 11.

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

No branches or pull requests

2 participants