Skip to content

Instantly share code, notes, and snippets.

@GrzegorzDyrda
Last active December 7, 2017 14:50
Show Gist options
  • Save GrzegorzDyrda/83499ae0b6c7a878b9be43c8c46e11e7 to your computer and use it in GitHub Desktop.
Save GrzegorzDyrda/83499ae0b6c7a878b9be43c8c46e11e7 to your computer and use it in GitHub Desktop.
/**
* Created by Grzegorz Dyrda on 2017-12-07
*/
import android.os.Handler
import android.os.Looper
private val mainHandler = Handler(Looper.getMainLooper())
fun postOnUiThread(action: () -> Unit) {
mainHandler.post(action)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment