@Override public void surfaceDestroyed(SurfaceHolder arg0) { boolean retry = true; m_gameThread.setRunning(false); while (retry) { try { m_gameThread.join(); retry = false; } catch (InterruptedException e) { // Try again... } } }
// Surface Functions @Override public void surfaceCreated(SurfaceHolder arg0) { loadBackgroundSourceBitmap(m_bgId); if (m_gameThread.getState() == Thread.State.TERMINATED) { m_gameThread = new GameThread(getHolder(), this); m_gameThread.setRunning(true); m_gameThread.start(); } else { m_gameThread.setRunning(true); m_gameThread.start(); } initPaths(m_paths); }