View.invalidate() does not seem to call View.onDraw()
android, invalidation
Solution
From android 3.0, when using Hardware acceleration, the drawing of views is recorded and stored at the GPU.
So when you got two views: A above B, and you call `B.invalidate`, `B.onDraw` will be called and record to the GPU, but `A.onDraw` will not be called because it's already recorded!
This is the different from non-hardware acceleration mode when all the views `onDraw` been called.
Problem
I have a drawing library, and with it I have a custom View. When any updates need to be done, the library calls the view's `invalidate()` method. And then the `onDraw()` method is called, and everything works just fine. However, when I add the attribute of `usesSdkVersion="14"` to my `AndroidManifest.xml file`, this stops working. No longer is my view's `onDraw()` method getting called anymore. MORE INFO: It seems that when I call `invalidate()` as the result of a button push in my app, the View updates as expected. Also, there is one animation inside my library which is working correctly. So apparently sometimes it is working correctly. But most of the time, it is not getting redrawn. Is there any state that a custom View can be in that would cause the OS to skip redrawing it after `invalidate()` is called?