https://kotlinlang.org logo
#announcements
Title
# announcements
j

Joey

12/06/2019, 1:32 AM
How to call suspend function from my kotlin library to java (android)? Thanks!
google 3
I found one article in the internet that we cannot call suspend function from kotlin to our java because they are compiled at run time? Correct me if im wrong. Thanks!
j

Joffrey

12/06/2019, 10:47 AM
Since suspend functions don't exist in Java, I believe what you want is rather to call from Java some suspend functions defined in a Kotlin library. There is already this question on StackOverflow: https://stackoverflow.com/questions/52869672/call-kotlin-suspend-function-in-java-class
2 Views