PhilipBrown Active Member Licensed User Longtime User May 30, 2015 #1 I've written an inline java callback routine which creates some data which I want to access within Basic code. I don't know how to send this data back to Basic. Because it's a callback, I cannot just return the data. Perhaps I have to store the data in a class and then query the class from Basic? Or is there an easier way?
I've written an inline java callback routine which creates some data which I want to access within Basic code. I don't know how to send this data back to Basic. Because it's a callback, I cannot just return the data. Perhaps I have to store the data in a class and then query the class from Basic? Or is there an easier way?
DonManfred Expert Licensed User Longtime User May 30, 2015 #2 Raise an event from within the inline java when the callback is raised Upvote 0
little3399 Active Member Licensed User Longtime User May 30, 2015 #3 It there a sample for this ? Upvote 0
DonManfred Expert Licensed User Longtime User May 30, 2015 #4 little3399 said: It there a sample for this ? Click to expand... Search the forum. There are a lot And crawl this... There are a lot of useful infos. Upvote 0
little3399 said: It there a sample for this ? Click to expand... Search the forum. There are a lot And crawl this... There are a lot of useful infos.
PhilipBrown Active Member Licensed User Longtime User May 30, 2015 #5 DonManfred said: Raise an event from within the inline java when the callback is raised Click to expand... Thanks very much for this suggestion. It seems like the right solution, but I'm getting an error. My code is Code: Copy Sub showManufacturerData (text As String) Log("showManufacturerData got " & text) End Sub #If JAVA if (processBA.subExists("showmanufacturerdata")) { processBA.raiseEvent("abc", "showmanufacturerdata"); } #End IF The error is Code: Copy java.lang.Exception: Sub showmanufacturerdata signature does not match expected signature. I get this error no matter what type of data I try to pass, although I try to adjust the Sub parameter type to match. I've searched this forum for this error and found lots of examples, but nothing which fits. Upvote 0
DonManfred said: Raise an event from within the inline java when the callback is raised Click to expand... Thanks very much for this suggestion. It seems like the right solution, but I'm getting an error. My code is Code: Copy Sub showManufacturerData (text As String) Log("showManufacturerData got " & text) End Sub #If JAVA if (processBA.subExists("showmanufacturerdata")) { processBA.raiseEvent("abc", "showmanufacturerdata"); } #End IF The error is Code: Copy java.lang.Exception: Sub showmanufacturerdata signature does not match expected signature. I get this error no matter what type of data I try to pass, although I try to adjust the Sub parameter type to match. I've searched this forum for this error and found lots of examples, but nothing which fits.
Erel B4X founder Staff member Licensed User Longtime User May 30, 2015 #6 (Note that B4X programming language is not the same as Basic and is not named Basic). The first parameter is the sender object. It should be: Code: Copy processBA.raiseEvent(null, "showmanufacturerdata", "abc") Upvote 0
(Note that B4X programming language is not the same as Basic and is not named Basic). The first parameter is the sender object. It should be: Code: Copy processBA.raiseEvent(null, "showmanufacturerdata", "abc")
PhilipBrown Active Member Licensed User Longtime User May 30, 2015 #7 Erel said: The first parameter is the sender object. It should be: Code: Copy processBA.raiseEvent(null, "showmanufacturerdata", "abc") Click to expand... That works. Thanks very much. Upvote 0
Erel said: The first parameter is the sender object. It should be: Code: Copy processBA.raiseEvent(null, "showmanufacturerdata", "abc") Click to expand... That works. Thanks very much.