From 3622ca84c9137f7193787ef82ec1171df3165ea0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 28 Mar 2019 12:26:03 +0100 Subject: [PATCH] properly handle going back to root of the USB storage in some cases --- .../filemanager/pro/activities/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt index 654d9108..6a6dcb57 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt @@ -234,7 +234,9 @@ class MainActivity : SimpleActivity() { var newPath = path val file = File(path) - if (file.exists() && !file.isDirectory) { + if (config.OTGPath.isNotEmpty() && config.OTGPath == path.trimEnd('/')) { + newPath = path + } else if (file.exists() && !file.isDirectory) { newPath = file.parent } else if (!file.exists() && !isPathOnOTG(newPath)) { newPath = internalStoragePath