B4X:
Sub CallSubX (Component As Object,SubName As String,Params() As Object)
Dim no As NativeObject=Component
Dim name As String=SubName
Dim ll As List
ll.Initialize2(Params)
For i =0 To Params.Length-1
name=name & ":"
Next
no.GetField("bi").RunMethod("raiseUIEvent:event:params:",Array(Null,name,ll))
End Sub
Example usage
B4X:
CallSubX (Me,"event_event",Array(1,"abc",3,"def",5)
Sub event_event(a as int, b as string, c as int, d as string, e as int)
Log(b)
End Sub