I created an extension function,
fun <T> Observable<T>.subscribeWithErrorHandling(onNext: (T) -> Unit ,onError: ((throwable: Throwable) -> Unit)? = null): Subscription {
//doing stuff
}
in kotlin class, I will be able to use it no problem in that way
observable.subscribeWithErrorHandling(...)
Now, I want to use this function in my java class as well. I already see that you can call it statically like :
MyExtensionFile.subscribeWithErrorHandling
But in my case, you need something else since it's a middle of an RX flow. And that is the part I'm stuck with. Does this is even possible? or no way to do something like that from the java code?