Skip to content

Instantly share code, notes, and snippets.

@NoNews
Last active January 3, 2022 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoNews/e5f4f8b72054fb86c879c14b02508129 to your computer and use it in GitHub Desktop.
Save NoNews/e5f4f8b72054fb86c879c14b02508129 to your computer and use it in GitHub Desktop.
//handler here is created with Looper.mainLooper()
override fun dispatch(context: CoroutineContext, block: Runnable) {
if (!handler.post(block)) {
cancelOnRejection(context, block)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment