try fetching SD card path on Android 4.x too
This commit is contained in:
parent
fb30d04a6e
commit
4de01e4baa
1 changed files with 0 additions and 4 deletions
|
@ -23,10 +23,6 @@ import java.util.regex.Pattern
|
|||
// http://stackoverflow.com/a/40582634/1967672
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
fun Context.getSDCardPath(): String {
|
||||
if (!isLollipopPlus()) {
|
||||
return ""
|
||||
}
|
||||
|
||||
val directories = getStorageDirectories().filter { it.trimEnd('/') != getInternalStoragePath() }
|
||||
val sdCardPath = directories.firstOrNull { !physicalPaths.contains(it.toLowerCase().trimEnd('/')) } ?: directories.firstOrNull() ?: ""
|
||||
return sdCardPath.trimEnd('/')
|
||||
|
|
Loading…
Reference in a new issue