Hi,
I've to integrate my app with a library that manage the communication of a device with a POS.
I initialize my class object with javaObject and run methods without problems. But the lib needs a method "Register(callbacksClass)" where I pass my activity istance to manage the callbacks methods.
So in my activity I should have these methods with annotations.
@MyTaskCompleted
public void onMyTaskCompleted(){...}
That's my code
How can I handle this event?
I tried with JO.CreateEvent but it doesn't work. Anyway I think that CreateEvent is not ok for this kind of method.
Thank you
I've to integrate my app with a library that manage the communication of a device with a POS.
I initialize my class object with javaObject and run methods without problems. But the lib needs a method "Register(callbacksClass)" where I pass my activity istance to manage the callbacks methods.
So in my activity I should have these methods with annotations.
@MyTaskCompleted
public void onMyTaskCompleted(){...}
That's my code
B4X:
Dim JO_1 AS JavaObject
JO_1 = JO_1.InitializeStatic("com.company.classname.classobject").RunMethod("getInstance",Null)
Result = JO_1.RunMethod("init",Array As Object(myProperties))
If Result = True Then
Dim StatusSuccess As Boolean
Dim myjarService As JavaObject
myjarService= JO_1.RunMethodJO("getService",Array As Object())
' here i send my istance
myjarService.RunMethod("register",Array As Object(Me))
'Then i try to create event with JO without success
End if
How can I handle this event?
I tried with JO.CreateEvent but it doesn't work. Anyway I think that CreateEvent is not ok for this kind of method.
Thank you