try opening folders from content uris too

This commit is contained in:
tibbi 2017-10-23 14:19:38 +02:00
parent 534a64c2f3
commit 5dc8907944
1 changed files with 12 additions and 2 deletions

View File

@ -88,8 +88,18 @@ class MainActivity : SimpleActivity() {
}
private fun initFileManager() {
if (intent.action == Intent.ACTION_VIEW && intent.data != null && intent.data.scheme == "file") {
openPath(intent.data.path)
if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
val data = intent.data
if (data.scheme == "file") {
openPath(data.path)
} else {
val path = getRealPathFromURI(data)
if (path != null) {
openPath(path)
} else {
openPath(config.homeFolder)
}
}
} else {
openPath(config.homeFolder)
}