don't require "://" in URL, only require ":" -> works for tel:12345 URLs

use ActionDial instead of ActionView for tel: URLs
This commit is contained in:
Philipp Crocoll 2016-01-13 20:37:23 +01:00
parent 64e265b2be
commit 1c7535c8ed
2 changed files with 4 additions and 2 deletions

View File

@ -1066,7 +1066,7 @@ namespace keepass2android
if (url == null) return false; if (url == null) return false;
// Default http:// if no protocol specified // Default http:// if no protocol specified
if (!url.Contains("://")) if ((!url.Contains(":") || (url.StartsWith("www."))))
{ {
url = "http://" + url; url = "http://" + url;
} }

View File

@ -103,7 +103,9 @@ namespace keepass2android
else else
{ {
Uri uri = Uri.Parse(url); Uri uri = Uri.Parse(url);
context.StartActivity(new Intent(Intent.ActionView, uri)); context.StartActivity(new Intent(
url.StartsWith("tel:") ? Intent.ActionDial : Intent.ActionView,
uri));
} }
} }
} }