Skip to content Skip to sidebar Skip to footer

Webview Not Loading Correctly In Application

I have an application that has a tab widget in it. One of the tabs loads a webview for me and it is not loading correctly. when i load the same address in just my phone browser i

Solution 1:

First, you need android.permission.INTERNET permission.

Second, you may need setJavaScriptEnabled(true) to settings, and do loadUrl at the very last.

webview.getSettings().setBuiltInZoomControls(true);
webview.setInitialScale(1);
webview.getSettings().setAppCacheEnabled(false);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://canyonculberts.com/ucc/?page_id=93");

Solution 2:

You have to try this code It wiil help you!

WebViewwebview=newWebView(this);
    setContentView(webview);

         WebSettingswebSettings= web.getSettings();

         webSettings.setJavaScriptEnabled(true);

         webview.loadUrl("url");

Solution 3:

Try with this..

            webView = (WebView) findViewById(R.id.webview);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(newWebViewClient());
    webView.loadUrl("http://www.google.com");

Solution 4:

Actually, After I tried many times .. I Solved it by adding this line.

mWebView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Mobile Safari/537.36");

Post a Comment for "Webview Not Loading Correctly In Application"