From b1f2316792f142b5b7e409f5f76ff3986c840315 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 14 Feb 2021 10:04:03 +0100 Subject: [PATCH] fix #656, prepend website with https if needed --- .../simplemobiletools/contacts/pro/extensions/Context.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt index e68943e9..99223039 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt @@ -80,8 +80,14 @@ fun Context.sendAddressIntent(address: String) { } fun Context.openWebsiteIntent(url: String) { + val website = if (url.startsWith("http")) { + url + } else { + "https://$url" + } + Intent(Intent.ACTION_VIEW).apply { - data = Uri.parse(url) + data = Uri.parse(website) if (resolveActivity(packageManager) != null) { startActivity(this) } else {