mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 20:38:40 +00:00
Do what the doc says: if no CustomChrome tab is available, try to open the Url in any installed browser.
This commit is contained in:
+2
-1
@@ -13,6 +13,7 @@ import android.net.Uri
|
|||||||
import androidx.browser.customtabs.CustomTabColorSchemeParams
|
import androidx.browser.customtabs.CustomTabColorSchemeParams
|
||||||
import androidx.browser.customtabs.CustomTabsIntent
|
import androidx.browser.customtabs.CustomTabsIntent
|
||||||
import androidx.browser.customtabs.CustomTabsSession
|
import androidx.browser.customtabs.CustomTabsSession
|
||||||
|
import io.element.android.libraries.androidutils.system.openUrlInExternalApp
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open url in custom tab or, if not available, in the default browser.
|
* Open url in custom tab or, if not available, in the default browser.
|
||||||
@@ -53,6 +54,6 @@ fun Activity.openUrlInChromeCustomTab(
|
|||||||
}
|
}
|
||||||
.launchUrl(this, Uri.parse(url))
|
.launchUrl(this, Uri.parse(url))
|
||||||
} catch (activityNotFoundException: ActivityNotFoundException) {
|
} catch (activityNotFoundException: ActivityNotFoundException) {
|
||||||
// TODO context.toast(R.string.error_no_external_application_found)
|
openUrlInExternalApp(url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user