Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

SDK 19+ External Storage (SD Card) Not working along with SDK 26+ not working from internal storage #73

Merged
merged 1 commit into from
Sep 16, 2018

Conversation

mikemike396
Copy link
Contributor

Fix for SDK 19+

  • When selecting media from external storage (SD Card) on a device running SDK 19+ I was receiving a null reference. It appears the ("primary".equalsIgnoreCase(type)) was never met and would just return "". I added an else case to handle this with the getExternalMediaDirs() call.

Fix for SDK 26+

  • When selecting media from internal storage Long.valueOf(id) would crash NumberFormatException since the id is a URI. This was changed on Android 26+. I added a check for "raw" and return the URI directly in that case.

- When selecting media from external storage (SD Card) on a device running SDK 21+ I was receiving a null reference. It appears the ("primary".equalsIgnoreCase(type)) was never met and would just return "". I added an else case to handle this with the getExternalMediaDirs() call.

Fix for SDK 26+
- When selecting media from internal storage Long.valueOf(id) would crash NumberFormatException since the id is a URI. This was changed on Android 26+. I added a check for "raw" and return the URI directly in that case.
@alhazmy13 alhazmy13 merged commit 3b696dc into alhazmy13:master Sep 16, 2018
@alhazmy13
Copy link
Owner

Thanks @mikemike396
Version 2.4.4 is out

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

Successfully merging this pull request may close these issues.

2 participants