Android webview 3.0 + shows that hardware acceleration must be enabled for flash. To enable hardware acceleration, add Android: hardwareaccelerated = "true" to manifest"
However, webview may flash when hardware acceleration is enabled. The solution is to set in webview:
Setlayertype (view. layer_type_software, null );
This is to disable hardware acceleration in webview. After layer_type_software is set, the current view is converted to bitmap and saved. In this way, you cannot open multiple webviews. Otherwise, an out of memory error is reported.
The solution is to add the following content to webview:
Protected void onmeasure (INT widthmeasurespec, int heightmeasurespec ){
Invalidate ();
Super. onmeasure (widthmeasurespec, heightmeasurespec );
}
2013 update:
Recently, I found a problem. After setting the background (black) for webview, a black screen will pop up on HTC One (4.0.3) and G20. The result is changed to the background setting function.
Setbackgroundcolor (color. parsecolor ("#000000"); // OK will not flash black screen
Setbackgroundcolor (0x000000); // black screen will pop up