Pause and resume thread drawing to SurfaceView

Posted by fhucho on Stack Overflow See other posts from Stack Overflow or by fhucho
Published on 2010-03-20T14:22:27Z Indexed on 2010/03/20 14:31 UTC
Read the original article Hit count: 327

Filed under:
|
|
|

I am developing a chess game for Android (http://androidchess.appspot.com), using SurfaceView for the chessboard. I have a drawing Thread, that draws the chessboard in a loop. The problem is that when there are no active animations (this is more that 90% of time), it makes no sense to waste CPU and battery for drawing. How should I solve this? Maybe somehow pausing and resuming the drawing Thread?

© Stack Overflow or respective owner

Related posts about android

Related posts about java