assertOnUiThread

open fun assertOnUiThread()

Throws an AssertionException if the current thread is not the UI thread. This is a noop in production, and is only meant to run in debug mode! If you need to check for incorrect-thread issues in production, duplicate this code and call it elsewhere.