Created
December 17, 2017 20:58
-
-
Save abdurahmanadilovic/98c185b88fc8f948c06406b51461499f to your computer and use it in GitHub Desktop.
Canceling all coroutine jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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