The problem appears to be associated with hardware acceleration which is enabled by default if the API level is >= 14.
I have an app with a ScrollView
that contains a number of views that I want to scroll as a single unit similar to the original poster - one of those views is a web view that wraps its content. If hardware acceleration is on and the rendered WebView
is at all complex (images, borders, etc) then the drawing cache error message can be seen in LogCat. Some screen with 12 items worked while the next screen with 13 items did not work. I don't think that its the number of items that makes a difference, but the complexity of the final rendered screen.
The symptoms are typically a blank WebView
- the other views are visually present and full formed. Very occasionally I see the whole screen blank, but that may have been while I was futzing with various suggestions found here on SO.
The message is not always seen. For example, I see the issue on a Samsung Galaxy 4 Mini running 4.2.2, while on other 4.x devices such as my cheap Chinese Samsung S3 clone running 4.1.2 everything is fine. I've not seen it on any 1.x or 2.x devices.
I tried to selectively turn off hardware acceleration on various views and layouts in the view hierarchy but in the end just turned of hardware acceleration for the whole app in the manifest file out of frustration and seeing how many hours I've wasted tracking this down.
After turning off hardware acceleration all issues have gone away. I see no noticeable performance differences on any of my devices. Presumably the 1.x and 2.x devices never used hardware acceleration in the first place, and my 4.x devices must be fast enough to cope with software only rendering. Not that my screens are that complicated.
Update APRIL 2015
Unfortunately the warning message is back on the Samsung Galaxy 4 Mini now running 4.4.2 even with hardware acceleration turned off. I have a webview with a JavaScript panel open/close animation. Everything works fine except that the initial layout (panel open) raises these warnings, and everytime I close or open the panel I also get them. These warnings are now just annoying, the app works fine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…