immagonnagetya
immagonnagetya

Reputation: 101

Android webkit bug: white screen flashed (for < 1 second) when changing webview URLs

Bug report: http://code.google.com/p/android/issues/detail?id=25722

Anyone has a workaround/ webcore hack for this reported bug? My client's website is made up of pages with a black background and the flashing white screen's really bad.

Android SDK - Ice cream sandwich

Upvotes: 2

Views: 806

Answers (2)

immagonnagetya
immagonnagetya

Reputation: 101

Programmatically changing the parameters of glClearColor used by webkit to change the background worked for me. Webkit's libwebcore needs to be rebuilt! :)

Upvotes: 0

Matt Gaunt
Matt Gaunt

Reputation: 9821

Have you tried setting the background of the WebView to black?

webView.setBackgroundColor(Color. BLACK);

Edit:

Sorry I completely overlooked the bug report.

I think setting to a software layer if the android version is ICS may be the safest / most reliable option:

if(Build.VERSION.SDK_INT == Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

You may also want to include Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1

Upvotes: 3

Related Questions