Kotlin/Android: Updating a progressbar from a IO coroutine

Kotlin/Android: Updating a progressbar from a IO coroutine

Watching this tutorial on coroutines and jobs:
https://www.youtube.com/watch?v=UsHTxOILP5g

The tutor simply updates the progress of the progressbar within the IO coroutine.
Is this allowed, possible? Shouldn’t all GUI stuff handled in the main thread? Why doesn’t his app crash?

This question gets asked quite a lot in the comment section of the video, however never really got answered…

submitted by /u/TCW_Jocki
[link] [comments]