From: Soren Stoutner Date: Sat, 26 Sep 2015 20:04:21 +0000 (-0700) Subject: Convert full intent Uri to formattedUrlString. X-Git-Tag: v1.0~49 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=b552bcdeaf58d3c98b534826cd434300028bd1b6;p=PrivacyBrowserAndroid.git Convert full intent Uri to formattedUrlString. --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/Webview.java b/app/src/main/java/com/stoutner/privacybrowser/Webview.java index abbc170f..a0455bc9 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/Webview.java +++ b/app/src/main/java/com/stoutner/privacybrowser/Webview.java @@ -74,18 +74,9 @@ public class Webview extends AppCompatActivity { final Intent intent = getIntent(); if (intent.getData() != null) { - // Get the intent data. + // Get the intent data and convert it to a string. final Uri intentUriData = intent.getData(); - - // Try to parse the intent data and store it in urlData. - URL urlData = null; - try { - urlData = new URL(intentUriData.getScheme(), intentUriData.getHost(), intentUriData.getPath()); - } catch (Exception e) { - e.printStackTrace(); - } - - Webview.formattedUrlString = urlData.toString(); + Webview.formattedUrlString = intentUriData.toString(); } // If formattedUrlString is null assign the homepage to it.