I created an extension function for rxjava2's Obse...
# android
l
I created an extension function for rxjava2's Observable class. How do you invoke an extension function from Java code?
m
You have to pass the observable object as it's first parameter and then other parameters if any as well
You cannot call it on the object as if it is a member function but rather as a normal utility function
l
Can you paste a snippet of what that looks like
that seems to defeat the purpose of an extension function
since you cant invoke it like
string.fooBar()
i guess ill just resort to ObservableTransformer
m
foorBar("Something");
Entensions doesn't work in Java the way they do in Kotlin
Under the hood that is how they are implemented in bytecode. Please decompile any kotlin file by clicking Tools -> Kotlin -> Bytecode and then click decompile in the bytecode window.
l
thanks for the pointers