Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private NativeMe As JavaObject
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
End Sub
Private Sub Button1_Click
Dim MyInlineClass As JavaObject
MyInlineClass.InitializeNewInstance((Me).As(String).Replace("class ","") & "$" & "MyInlineClass",Null)
'MyInlineClass.InitializeNewInstance("b4a.example.main$MyInlineClass",Null) ' change to suit b4j or b4a
'...
Log(MyInlineClass.RunMethod("Hello",Array("fred")))
'...
End Sub
#If Java
public static class MyInlineClass{
public MyInlineClass(){}
public String Hello(String s){
return "Hello there " + s;
}
}
#End if