You cannot use SAM conversion for interfaces with more than one method (Single Abstract Method)
Instead you can write extension function where you pass 2 lambdas (also works good with default argument)
a
Ayden
08/23/2018, 11:06 AM
I see. But what you said was too difficult for me to understand. 😂
Still newbie right now. On the way to become pro.
g
gildor
08/23/2018, 11:08 AM
SAM is a technique from Java 8 (that also used in Kotlin for interop with Java) that allows you to use interface or abstract class with 1 method as lambda
a
Ayden
08/23/2018, 11:08 AM
I will take a look on that later.
Actually I come from PHP. So I do not have any knowledge about OOP. 😞
g
gildor
08/23/2018, 11:10 AM
Instead, you can do something like this (for this case I just combine 2 callbacks to one, but it works only for cases like this: