https://kotlinlang.org logo
Title
a

Ayden

08/02/2018, 2:14 PM
Just remove the
object: Runnable
?
l

Luke

08/02/2018, 2:16 PM
Handler().postDelayed({
    ...
}, 2000)
👍 1
a

Ayden

08/02/2018, 2:23 PM
In Kotlin the object: Runnable() is not necessary?
l

Luke

08/02/2018, 2:28 PM
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

rkeazor

08/02/2018, 2:28 PM
if its not a SAM than it requires that format
there is a getting-started slack channel ,where you can get more info
p

Paul Woitaschek

08/02/2018, 9:09 PM
Therer is a ktx extension that reorders the argument
so you can move the lambda outside the parenthesis
Handler().postDelayed(2000) { ... }
😮 2