code: private void stopBackgroundThread() {
  		mBackgroundThread.quitSafely();
  		try {
  			mBackgroundThread.join();
  			mBackgroundThread = null;
  			mBackgroundHandler = null;
  		} catch (InterruptedException e) {
  			e.printStackTrace();
  		}
  	}
docs: Stops the background thread and its {@link Handler}.