protected var mCoroutineContext = Job() + Dispatchers.Default + CoroutineExceptionHandler { _, throwable -> Crashlytics.logException(throwable) } override fun onStopped() { mCoroutineContext.runCatching { if (this.isActive) { try { this.cancel() } catch (e: CancellationException) { Timber.d("Work as cancelled successfully") } } mCancellableContinuation = null } super.onStopped() }