From e86f193379868c495d5b48a76cbdedc06a03f3a9 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Thu, 24 Sep 2015 16:22:09 -0700 Subject: [PATCH] Update formattedUrlString on click. --- app/src/main/java/com/stoutner/privacybrowser/Webview.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/stoutner/privacybrowser/Webview.java b/app/src/main/java/com/stoutner/privacybrowser/Webview.java index 16c52415..abbc170f 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/Webview.java +++ b/app/src/main/java/com/stoutner/privacybrowser/Webview.java @@ -36,10 +36,11 @@ public class Webview extends AppCompatActivity { progressBar = (ProgressBar) findViewById(R.id.progressBar); // setWebViewClient makes this WebView the default handler for URLs inside the app, so that links are not kicked out to other apps. - // Save the URL to urlTextBox before loading mainWebView. + // Save the URL to formattedUrlString and update urlTextBox before loading mainWebView. mainWebView.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { - urlTextBox.setText(url); + formattedUrlString=url; + urlTextBox.setText(formattedUrlString); mainWebView.loadUrl(url); return true; } -- 2.45.2