From 9523d99614150970890e0d01cf0bf5e38c6ccf14 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 16 Sep 2015 13:14:33 -0700 Subject: [PATCH] Implement setWebViewClient to allow Privacy Browser to follow links. --- app/src/main/java/com/stoutner/privacybrowser/Webview.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/stoutner/privacybrowser/Webview.java b/app/src/main/java/com/stoutner/privacybrowser/Webview.java index ab78eee0..6e8f237e 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/Webview.java +++ b/app/src/main/java/com/stoutner/privacybrowser/Webview.java @@ -11,6 +11,7 @@ import android.view.MenuItem; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.webkit.WebView; +import android.webkit.WebViewClient; import android.widget.EditText; import java.net.URL; @@ -30,6 +31,9 @@ public class Webview extends ActionBarActivity { final EditText urlTextBox = (EditText) findViewById(R.id.urlTextBox); mainWebView = (WebView) findViewById(R.id.mainWebView); + // setWebViewClient makes this WebView the default handler for URLs inside the app, so that links are not kicked out to other apps. + mainWebView.setWebViewClient(new WebViewClient()); + // Allow pinch to zoom. mainWebView.getSettings().setBuiltInZoomControls(true); -- 2.45.2