Replacing View with SurfaceView to draw on other than the UI Thread
问题 The following program does not work unless the line while (!done) (and the closing bracket) are uncommented. Do you understand why? Why is it not possible to ask the thread to run the drawing code just once? public class MySurfaceView extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder holder; private MyThread myThread; private boolean hasSurface; protected float x, y; protected Paint paint; public MySurfaceView(Context context, AttributeSet attrs) { super(context,