From 1c7535c8edb3d7c83da32630860796523c0e9640 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Wed, 13 Jan 2016 20:37:23 +0100 Subject: [PATCH] don't require "://" in URL, only require ":" -> works for tel:12345 URLs use ActionDial instead of ActionView for tel: URLs --- src/keepass2android/EntryActivity.cs | 2 +- src/keepass2android/Utils/Util.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/keepass2android/EntryActivity.cs b/src/keepass2android/EntryActivity.cs index 783f8234..11a3fb5a 100644 --- a/src/keepass2android/EntryActivity.cs +++ b/src/keepass2android/EntryActivity.cs @@ -1066,7 +1066,7 @@ namespace keepass2android if (url == null) return false; // Default http:// if no protocol specified - if (!url.Contains("://")) + if ((!url.Contains(":") || (url.StartsWith("www.")))) { url = "http://" + url; } diff --git a/src/keepass2android/Utils/Util.cs b/src/keepass2android/Utils/Util.cs index 31a8dc3f..105929e3 100644 --- a/src/keepass2android/Utils/Util.cs +++ b/src/keepass2android/Utils/Util.cs @@ -103,7 +103,9 @@ namespace keepass2android else { Uri uri = Uri.Parse(url); - context.StartActivity(new Intent(Intent.ActionView, uri)); + context.StartActivity(new Intent( + url.StartsWith("tel:") ? Intent.ActionDial : Intent.ActionView, + uri)); } } }