예제 #1
0
  @Override
  public void surfaceCreated(SurfaceHolder holder) {
    if (thread.getState() == Thread.State.TERMINATED) {
      thread = new GameLoopThread();
    }

    // start the game loop
    thread.setIsRunning(true);
    thread.start();
  }
예제 #2
0
  // SurfaceHolder.Callback methods:
  @Override
  public void surfaceCreated(SurfaceHolder surfaceHolder) {
    // thread exists, but is in terminated state
    if (thread.getState() == Thread.State.TERMINATED) {
      thread = new GameLoopThread();
    }

    // start the game loop
    thread.setIsRunning(true);
    thread.start();
  }