fix #656, prepend website with https if needed
This commit is contained in:
parent
49241363a1
commit
b1f2316792
1 changed files with 7 additions and 1 deletions
|
|
@ -80,8 +80,14 @@ fun Context.sendAddressIntent(address: String) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.openWebsiteIntent(url: String) {
|
fun Context.openWebsiteIntent(url: String) {
|
||||||
|
val website = if (url.startsWith("http")) {
|
||||||
|
url
|
||||||
|
} else {
|
||||||
|
"https://$url"
|
||||||
|
}
|
||||||
|
|
||||||
Intent(Intent.ACTION_VIEW).apply {
|
Intent(Intent.ACTION_VIEW).apply {
|
||||||
data = Uri.parse(url)
|
data = Uri.parse(website)
|
||||||
if (resolveActivity(packageManager) != null) {
|
if (resolveActivity(packageManager) != null) {
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue