Skip to content Skip to sidebar Skip to footer

Android Webview Shows A Blank Page

Trying to create a WebView but it only shows a blank/white page. I have followed several examples and they all say that work with this code... Here is my code: import android.app.A

Solution 1:

You need to enable Javascript (.getSettings().setJavaScriptEnabled(true)), or choose a Web page that does not rely upon Javascript.

Solution 2:

You have to add the permission to your AndroidManifest.xml file.

<uses-permissionandroid:name="android.permission.INTERNET"></uses-permission>

Solution 3:

Use webview.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null); method

Solution 4:

It's works fine for me

WebView webView = (WebView)findViewById(R.id.webView);

webView.setWebViewClient(newWebViewClient() {
    @OverridepublicbooleanshouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        returnfalse;
    }
});

webView.loadUrl("http://www.google.com");

Good Luck!

Solution 5:

You might be getting redirected.. just install a webviewclient allong with you web view :)

Post a Comment for "Android Webview Shows A Blank Page"