Skip to content Skip to sidebar Skip to footer

Web View Shows Blank/white Page After Loading Url When Using Wifi In Android

My webview loads the URL which I load on to it in both Android emulator and device (using 3G). When I load the same web page with wifi it returns a blank/white page. mWebView =

Solution 1:

Please add

@OverridepublicvoidonReceivedSslError(WebView view, SslErrorHandler handler, SslError error) 
{
handler.proceed(); // Ignore SSL certificate errors
}

inside setWebViewClient.

Solution 2:

There are possible reasons causing "WebView goes blank after finish loading page":

  1. If your WebView part defined in the layout xml file has dimensions like

    android:layout_width="wrap_content"
    
    or
    android:layout_height="wrap_content"
    

    Then after the page is loaded, the content is defined and WebView tries to "wrap" it, thus in some cases reduces the view's dimensions into 0dp and make your WebView invisible. Answer : change all those into fill_parent

    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    
  2. This may be caused by an SSL certification error. Try this:

    public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
        handler.proceed();
    }
    
    

Post a Comment for "Web View Shows Blank/white Page After Loading Url When Using Wifi In Android"