コード例 #1
0
 public void surfaceCreated(SurfaceHolder holder) {
   if (!running) {
     running = true;
     thread.setMode(Mode.RUNNING);
     thread.start();
   } else {
     thread.resume();
   }
 }
コード例 #2
0
  public void surfaceDestroyed(SurfaceHolder holder) {
    thread.setMode(Mode.STOPPED);

    boolean retry = true;
    while (retry) {
      try {
        thread.join();
        retry = false;
      } catch (InterruptedException e) {
      }
    }
  }