Hi,
I have to integrate a 3th part library for POS comunication.
I can initialize libs objects and execute methods with JavaObject (like makePayment), but I can't intercept the callback event (makePayment_completed).
This should works with Android handler and HandlerMessages.
They told me that handler in java should be something like this:
We tried to do this in b4a in this way:
The callbacksObject (in our case "myServiceHandler") variable passed to the register method is the instance of a class, it is a simple class that extends Application (Android class), but it could also be an Activity or a base class or this."
But Callback_Event is not raised.
Do you see something wrong?
Thank you.
I have to integrate a 3th part library for POS comunication.
I can initialize libs objects and execute methods with JavaObject (like makePayment), but I can't intercept the callback event (makePayment_completed).
This should works with Android handler and HandlerMessages.
They told me that handler in java should be something like this:
B4X:
private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
// Check the id throught msg.what
// Get the obj throught msg.obj,
// ....
}
};
We tried to do this in b4a in this way:
B4X:
myServiceHandler.InitializeNewInstance("android.os.Handler", Array As Object())[/INDENT]
msg_handler = myServiceHandler.CreateEventFromUI("android.os.Handler.Callback", "Callback", Null)
'Eseguo register
myPOSServiceObj.RunMethod("register",Array As Object(myServiceHandler))
'Executes the method that should raise my event after a while
myPOSServiceObj.RunMethod("makePayment",Array As Object("1",TotIntParse,Null))
The callbacksObject (in our case "myServiceHandler") variable passed to the register method is the instance of a class, it is a simple class that extends Application (Android class), but it could also be an Activity or a base class or this."
But Callback_Event is not raised.
Do you see something wrong?
Thank you.