Handle redirects in the app
Этот коммит содержится в:
@@ -8,8 +8,8 @@ android {
|
|||||||
applicationId 'org.traccar.manager'
|
applicationId 'org.traccar.manager'
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 27
|
versionCode 28
|
||||||
versionName '2.16'
|
versionName '2.17'
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import android.webkit.JavascriptInterface
|
|||||||
import android.webkit.ValueCallback
|
import android.webkit.ValueCallback
|
||||||
import android.webkit.WebChromeClient
|
import android.webkit.WebChromeClient
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
|
import android.webkit.WebViewClient
|
||||||
import android.webkit.WebViewFragment
|
import android.webkit.WebViewFragment
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
@@ -68,6 +69,7 @@ class MainFragment : WebViewFragment() {
|
|||||||
if ((activity.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
|
if ((activity.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
|
||||||
WebView.setWebContentsDebuggingEnabled(true)
|
WebView.setWebContentsDebuggingEnabled(true)
|
||||||
}
|
}
|
||||||
|
webView.webViewClient = WebViewClient() // handle redirects in the app
|
||||||
webView.webChromeClient = webChromeClient
|
webView.webChromeClient = webChromeClient
|
||||||
webView.addJavascriptInterface(AppInterface(), "appInterface")
|
webView.addJavascriptInterface(AppInterface(), "appInterface")
|
||||||
val webSettings = webView.settings
|
val webSettings = webView.settings
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user