Skip to content

Instantly share code, notes, and snippets.

@marcherdiego
Created July 29, 2020 21:37
Show Gist options
  • Save marcherdiego/7f8286bb46b28a5839b5492d05e2c6b8 to your computer and use it in GitHub Desktop.
Save marcherdiego/7f8286bb46b28a5839b5492d05e2c6b8 to your computer and use it in GitHub Desktop.
class MainModel {
fun doBackgroundWork() {
object : AsyncTask<Unit, Unit, Unit>() {
override fun doInBackground(vararg params: Unit?) {
// Heavy work
}
override fun onPostExecute(result: Unit?) {
bus.post(ServerCallCompletedEvent())
}
}.execute()
}
class ServerCallCompletedEvent
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment