But I’ve realised it is better to hide the suspending function inside a
ViewModel
and only expose non-suspend functions and
LiveData
to the
Activity
, but that is more of a personal preference.
j
Joey
12/06/2019, 7:08 AM
How to call this suspend function from kotlin library to java?
g
gildor
12/08/2019, 8:28 AM
From Kotlin to Java? What do you mean? Maybe you mean call it from Java? Short answer you cannot do this from Java, instead, expose suspend function using any asynchronous Java API: CompletableFuture, RxJava etc