Old thread, but thought I'd, add. These days, if you're using coroutines, a common way would be
scope.launch(Dispatchers.Main) { /* code to be executed on main thread */ }