Just remove the `object: Runnable`?
# android
a
Just remove the
object: Runnable
?
l
Copy code
Handler().postDelayed({
    ...
}, 2000)
­čĹŹ 1
a
In Kotlin the object: Runnable() is not necessary?
l
It's not that it's not necessary. In some cases, like this one, Kotlin is smart enough to convert a lambda to a Runnable since there is only one method to implement
r
if its not a SAM than it requires that format
there is a getting-started slack channel ,where you can get more info
p
Therer is a ktx extension that reorders the argument
so you can move the lambda outside the parenthesis
Handler().postDelayed(2000) { ... }
­čś« 2