```binding.button.setOnClickListener( View.OnClick...
# android
t
Copy code
binding.button.setOnClickListener( View.OnClickListener {

})

binding.button.setOnClickListener {

}
Hey guys I am confused why I was able to skip the parenthesis on the 2nd example. The method takes a functional interface, but not a function, so how am I allowed to use the passing trailing lambda syntax here?
1
a
It's part of Kotlin's interop when calling methods that were defined in Java code, trailing functional interface parameters can accept kotlin lambdas and the compiler more or less translates the second to the first.
2
439 Views