Source: http://blog.csdn.net/fhy_2008/article/details/7474330
Problem: WebView Loading page flashes
Cause: Turn on hardware acceleration
Solve:
Android WebView show Flash after 3.0+ to enable hardware acceleration, turn on hardware acceleration is added in manifest: android:hardwareaccelerated= "true"
However, after you turn on hardware acceleration, there may be a flicker problem with webview, and the workaround is to set it in WebView:
Setlayertype (view.layer_type_software, NULL);
This is the hardware acceleration shutdown in the webview. Setting Layer_type_software will convert the current view to bitmap save. This will not open multiple webview, otherwise it will be reported out of memory.
The workaround is to include the following in the WebView:
protected void onmeasure (int widthmeasurespec, int heightmeasurespec) {
Invalidate ();
Super.onmeasure (Widthmeasurespec, Heightmeasurespec);
}
2013 Update:
Recently, a problem has been found, after setting the background (black) for WebView, a black screen will be flashed on HTC One (4.0.3) and G20. As a result, the function of setting the background is changed.
SetBackgroundColor (Color.parsecolor ("#000000"))//ok will not flash black screen
SetBackgroundColor (0x000000);//Will flash black screen
WebView Flicker problem in Android