Android View.onDraw() always has a clean Canvas

Posted by CaseyB on Stack Overflow See other posts from Stack Overflow or by CaseyB
Published on 2010-03-11T07:48:04Z Indexed on 2010/03/31 20:13 UTC
Read the original article Hit count: 426

Filed under:
|
|

I am trying to draw an animation. To do so I have extended View and overridden the onDraw() method. What I would expect is that each time onDraw() is called the canvas would be in teh state that I left it in and I could choose to clear it or just draw over parts of it (This is how it worked when I used a SurfaceView) but each time the canvas comes back already cleared. Is there a way that I can not have it cleared? Or maybe save the previous state into a Bitmap so I can just draw that Bitmap and then draw over top of it?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-ui