From 05114053e3b4e13ec369113299c65ac1c250d613 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Jul 2021 09:12:42 -0700 Subject: Handle redirects in the app --- app/src/main/java/org/traccar/manager/MainFragment.kt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/src/main') diff --git a/app/src/main/java/org/traccar/manager/MainFragment.kt b/app/src/main/java/org/traccar/manager/MainFragment.kt index 3f09e56..d5144f5 100644 --- a/app/src/main/java/org/traccar/manager/MainFragment.kt +++ b/app/src/main/java/org/traccar/manager/MainFragment.kt @@ -36,6 +36,7 @@ import android.webkit.JavascriptInterface import android.webkit.ValueCallback import android.webkit.WebChromeClient import android.webkit.WebView +import android.webkit.WebViewClient import android.webkit.WebViewFragment import androidx.appcompat.app.AlertDialog import androidx.core.app.ActivityCompat @@ -68,6 +69,7 @@ class MainFragment : WebViewFragment() { if ((activity.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0) { WebView.setWebContentsDebuggingEnabled(true) } + webView.webViewClient = WebViewClient() // handle redirects in the app webView.webChromeClient = webChromeClient webView.addJavascriptInterface(AppInterface(), "appInterface") val webSettings = webView.settings -- cgit v1.2.3