Android webview don't show a part of website

117
December 17, 2018, at 03:00 AM

I need to load a proper site into webview. What I do:

webView.setInitialScale(1)
webView.webViewClient = MyWebViewClient()
webView.settings.allowFileAccess = true
webView.settings.pluginState = WebSettings.PluginState.ON
webView.settings.pluginState = WebSettings.PluginState.ON_DEMAND
webView.settings.javaScriptEnabled = true
webView.settings.loadWithOverviewMode = true
webView.settings.useWideViewPort = true

for site

webView.loadUrl("https://pnpcss.com/vxyfv2ey/?subId1=fonev")

custom WebView:

private class MyWebViewClient : WebViewClient() {
    @TargetApi(Build.VERSION_CODES.N)
    override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
        view.loadUrl(request.url.toString())
        return true
    }
    override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
        view.loadUrl(url)
        return true
    }
    override fun onPageFinished(view: WebView?, url: String?) {
        CookieManager.getInstance().getCookie(url)
        super.onPageFinished(view, url)
    }
}

What I have: Only the bottom part of site is loaded, the upper is not. If I use chrome on this android phone, it is loaded ok. Android versions tested: 5.0.1 & 8. What I do wrong?

Answer 1

The problem was in that iframe was not loaded. It is solved with settings.domStorageEnabled = true

Rent Charter Buses Company
READ ALSO
Can't install different android app version in Android Studio

Can't install different android app version in Android Studio

I'm developing an app in Android Studio which I've installed previously on a simulatorNow I want to simultaneously run an older version of same app on SAME sim

136
Delete An ArrayList from SharedPreferences

Delete An ArrayList from SharedPreferences

I know there are couple examples of this but i tried many of them and i couldn't fix my issueI want to delete an ArrayList from my shared preferences

130
Old Andoid loaded into new eclipse

Old Andoid loaded into new eclipse

I used to use Android 22 API with Eclipse Juno but now i downloaded Eclipse neon

168