I often wished the following code was valid
but alas, someVar doesn't exist on the right side until the dim statement is executed
so we have to use
but …..
if you add this tiny method
Now you can have
B4X:
Dim someVar as JavaObject = someVar.InitializeNewInstance("some.java.class",null)
so we have to use
B4X:
Dim someVar as JavaObject
someVar.InitializeNewInstance("some.java.class",null)
but …..
if you add this tiny method
B4X:
Sub New(javaClass as String, Values() as Object) As JavaObject
Dim Jo as JavaObject
Return Jo.InitiallizeNewInstance(javaClass,values)
End Sub
Now you can have
B4X:
Dim someVar As JavaObject = New("some.java.class",null)
Last edited: