1

My WebView works perfectly in Android 2.3 but on my Nexus S with 4.0 the pages don't get loaded properly anymore. The background color loads but nothing else.

What has changed with 4.0?

Thankful or any help I can get!

My WebView Code:

webView.setWebViewClient(new WebViewClient() { @Override public void onPageStarted(WebView view, String url, Bitmap favicon){ super.onPageStarted(view, url, favicon); webView.clearCache(true); } public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(Home.this, description, Toast.LENGTH_SHORT).show(); } }); webView.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { // Hide/Show loading animation } @Override public void onConsoleMessage(String message, int lineNumber, String super.onConsoleMessage(message, lineNumber, sourceID); } }); // SETUP WEBVIEW webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); webView.setInitialScale(1); webView.scrollBy(0, 0); webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); webView.setBackgroundColor(0x333333); webView.getSettings().setRenderPriority(RenderPriority.HIGH); webView.loadUrl(urlButton1); // Test webView.clearSslPreferences(); webView.getSettings().setAllowFileAccess(true); webView.getSettings().setLoadsImagesAutomatically(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); 
1
  • In the topmost middle there is a small square that looks like parts of the page.. really strange. Commented Feb 3, 2012 at 15:54

1 Answer 1

1

Just remove webView.setInitialScale(1); It doesn't work on ICS

Sign up to request clarification or add additional context in comments.

1 Comment

I accepted the answer since this did in fact help in one case. In another it does not however. Oh and yeah sorry for the late accept :D

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.