I have a class, let's say the name classa
There's a method in there, clear
I'm trying to reflect references externally,
dim a as classa
Dim r As reflect
r.Target = a
r.RunMethod("clear"), this sentence always prompts an error, what should I do, thanks
Sorry, the current input is wrong
dim a as classa
Dim r As reflector
r.Target = a
r.RunMethod("clear"), this sentence always prompts an error, what should I do, thanks
Of course, even directly (object.method).
I don't know why he wants to do this, but I would like to know the reason for the error generated (even if just out of curiosity).
I had thought about Release mode, tried it but got the same error.
Now I have written a new test project, B4XPages (yesterday it was not B4XPages project, "classic" B4J and B4A). For the moment I have only tried the B4J - Release mode project and the method is not found.
EDIT: B4A - Release: same error.
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private mobjSomething As clsSomething
Private mReflector As Reflector
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
mobjSomething.Initialize
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
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
mReflector.Target = mobjSomething
mReflector.RunMethod("LogText")
mReflector.RunMethod2("LogText2", "Ciao", "java.lang.String")
End Sub
clsSomething:
Sub Class_Globals
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
End Sub
Public Sub LogText
Log("LogText")
End Sub
Public Sub LogText2(Text As String)
Log("LogText")
End Sub