/** Stops the background thread and its {@link Handler}. */ private void stopBackgroundThread() { mBackgroundThread.quitSafely(); try { mBackgroundThread.join(); mBackgroundThread = null; mBackgroundHandler = null; } catch (InterruptedException e) { e.printStackTrace(); } }
private void closeBackgroundThread() { backHandlerThread.quitSafely(); try { backHandlerThread.join(); backHandlerThread = null; mHandler = null; } catch (Exception e) { e.printStackTrace(); } }
/** Stops the background thread and its {@link Handler}. */ private void stopBackgroundThread() { backgroundThread.quitSafely(); try { backgroundThread.join(); backgroundThread = null; backgroundHandler = null; } catch (final InterruptedException e) { LOGGER.e(e, "Exception!"); } }
private final void stopChoreographerThread() { if (null != mChoreographerThread) { Choreographer.getInstance().removeFrameCallback(mFrameCallback); mChoreographerThread.quitSafely(); try { mChoreographerThread.join(); } catch (final Exception ignored) { } finally { mChoreographerThread = null; } } }
private void stopDraw() { if (handler != null) { handler.quit(); handler = null; } if (mDrawThread != null) { try { mDrawThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } mDrawThread.quit(); mDrawThread = null; } }
public void end() { mEndFlag = true; synchronized (mDrawingNotify) { mDrawingNotify.notifyAll(); } if (mHandler != null) { mHandler.pause(); mHandler = null; } if (mThread != null) { try { mThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } mThread.quit(); mThread = null; } }