You can always add `run(UI)` for them just to make...
# coroutines
e
You can always add
run(UI)
for them just to make sure they are on the right thread (it will not switch if you invoke them from the right thread). Ideally, we should have tooling where you’d annotate your UI functions with
@UI
(or even better — make this annotation inferred by looking at their code and seeing that they use some other UI-thread-only functions) and then it would warn you if you try to use them from the wrong context…. Just an idea.
g
Yes, it’s quite challenging in case of Android Framework or even your own application. As I know there is no
@MainThread
annotation in Android Framework, only some methods in Support Library But still, tooling support is crucial thing even for such limited usage.