Skip to content

Commit 5dc8907

Browse files
committed
try opening folders from content uris too
1 parent 534a64c commit 5dc8907

File tree

1 file changed

+12
-2
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/activities

1 file changed

+12
-2
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,18 @@ class MainActivity : SimpleActivity() {
8888
}
8989

9090
private fun initFileManager() {
91-
if (intent.action == Intent.ACTION_VIEW && intent.data != null && intent.data.scheme == "file") {
92-
openPath(intent.data.path)
91+
if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
92+
val data = intent.data
93+
if (data.scheme == "file") {
94+
openPath(data.path)
95+
} else {
96+
val path = getRealPathFromURI(data)
97+
if (path != null) {
98+
openPath(path)
99+
} else {
100+
openPath(config.homeFolder)
101+
}
102+
}
93103
} else {
94104
openPath(config.homeFolder)
95105
}

0 commit comments

Comments
 (0)