Can KCallable be interchanged with Callable? I nee...
# announcements
a
Can KCallable be interchanged with Callable? I need to pass in a method reference to a Java method that uses Callable as a parameter but it seems as though that the kotlin function references aren't the same as Java, and they only work with KCallable. I tried to cast KCallable to Callable but I ended up getting a casting exception saying that they can't be casted properly. Is there some way to do this safely? Or is there a way to pass in a java method reference in kotlin?
a
@alexcouch you could use SAM conversion
a
Excuse me?
a
Lemme show the code that I have so you can better understand what I'm needing. I'm sure the SAM conversion is what I need but I need to know how to do it.
Nevermind I got it. Don't know what I did different but I got it. It was throwing errors last time but not anymore