Esempio n. 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();
  }
  // 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();
  }