postOnMainThread

fun postOnMainThread(function: () -> Unit)

Execute function on Android Main thread.

If called from Android Main thread - will be executed immediately in the same callchain otherwise will be posted on Android Main thread explicitly.