Skip to content

Instantly share code, notes, and snippets.

@abdurahmanadilovic
Created December 17, 2017 20:58
Show Gist options
  • Save abdurahmanadilovic/98c185b88fc8f948c06406b51461499f to your computer and use it in GitHub Desktop.
Save abdurahmanadilovic/98c185b88fc8f948c06406b51461499f to your computer and use it in GitHub Desktop.
Canceling all coroutine jobs
private val parentJob = Job()
override fun onResume() {
super.onResume()
getAllUsers()
getAllPosts()
}
override fun onPause() {
super.onPause()
parentJob.cancel()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment