class C{
var l: () -> Unit = {println("hello")};
fun onClick(){ l() }}
val c = C()
c.l = { println("world") }
is this ok?
b
bezrukov
07/12/2021, 12:24 PM
what is your question? what would you expect from this code?
Answering your current question - yes, this is ok
☝️ 2
i
Ifvwm
07/12/2021, 12:36 PM
the original question is I want avoid multiple click on View.setOnClickListener, so I use a class to inherit and use variable to store latest click time, to check if it's click so often