/** * Stop looper thread. This pre-destroy hook just stops this looper thread. Subclass may need to defined specific * clean-up logic. It can override this hook but should explicitly invoke super. Otherwise looper thread is not * stopped and runs indefinitely. * * @throws Exception exceptions from application defined clean-up logic are bubbled up. */ @Override public void preDestroy() throws Exception { thread.stop(); } }