From: Soren Stoutner Date: Wed, 16 Sep 2015 20:14:33 +0000 (-0700) Subject: Implement setWebViewClient to allow Privacy Browser to follow links. X-Git-Tag: v1.0~57 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=9523d99614150970890e0d01cf0bf5e38c6ccf14;p=PrivacyBrowserAndroid.git Implement setWebViewClient to allow Privacy Browser to follow links. --- 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);