public void killThread() { boolean retry = true; gthread.setRunning(false); while (retry) { try { gthread.join(); retry = false; } catch (InterruptedException e) { } } }
/* * Callback invoked when the Surface has been destroyed. */ public void surfaceDestroyed(SurfaceHolder holder) { boolean retry = true; thread.setRunning(false); while (retry) { try { thread.join(); retry = false; } catch (InterruptedException e) { Log.e("Tile Game Example", e.getMessage()); } } }
public void surfaceDestroyed(SurfaceHolder holder) { if (thread != null) { boolean retry = true; thread.setRunning(false); while (retry) { try { thread.join(); retry = false; } catch (InterruptedException e) { } } } thread = null; }
public void surfaceDestroyed(SurfaceHolder holder) { // Destroy the thread if (myThread.isAlive()) { myThread.startRun(false); } boolean retry = true; while (retry) { try { myThread.join(); retry = false; } catch (InterruptedException e) { } } }