diff --git a/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt b/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt index 3d396de19a..5194a1bba4 100644 --- a/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt +++ b/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt @@ -147,8 +147,19 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic if (result.isFile) { openFile(result.remotePath()) } else { - val uri = Uri.parse(result.resourceUrl) - this.browserUri.value = uri + this.browserUri.value = getResultUri(result) + } + } + + private fun getResultUri(result: SearchResultEntry): Uri { + val uri = Uri.parse(result.resourceUrl) + return when (uri.host) { + null -> { + val serverUrl = currentAccountProvider.user.server.uri.toString() + val fullUrl = serverUrl + result.resourceUrl + Uri.parse(fullUrl) + } + else -> uri } }