From b552bcdeaf58d3c98b534826cd434300028bd1b6 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Sat, 26 Sep 2015 13:04:21 -0700 Subject: [PATCH] Convert full intent Uri to formattedUrlString. --- .../java/com/stoutner/privacybrowser/Webview.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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. -- 2.45.2