I want to know how to get the return value from a function called B4X from inline JAVA.
B4X:
Private Sub Button1_Click
Me.As(JavaObject).RunMethod("sum", Array(1,2))
End Sub
Sub getsum(a As Int,b As Int) As String
Return a+b
End Sub
#if java
public void sum(Int a,Int b){
getBA().raiseEventFromUI(this, "getsum",a,b);
BA.Log(???); //How to get the return value=3
}
#End If
The first question has not been answered yet, and now there is also a new question. How to call Resumable subs that return values from inline JAVA
B4X:
Sub a()As ResumableSub
dim i as int
for i = 1 to 10
log(i)
sleep(10)
next
return true
End Sub
#if java
public void test(){
// How to use functions like Wait for to call a here
BA.Log("finish");
}
#End If