Search code examples
androidwebviewandroid-webviewandroid-4.0-ice-cream-sandwich

WebView shows transparent color while navigating back to Webview from next screen on ICS (Android 4)


In Android 4, CSS is ignored while navigating back to Webview from next Screen. For first time this works fine.

This behavior is only for Transparent color. Other color works fine.

WebView webView = new WebView(activity);
webView.getSettings().setJavaScriptEnabled(true);

webView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NORMAL) ;
/**
 * Default color of webview must be transparent
 */
webView.setBackgroundColor(Color.TRANSPARENT);

Solution

  • After many tries found it was device issue!!.. :(