Android Question Accessing InLine data from Basic

Discussion in 'Android Questions' started by PhilipBrown, May 30, 2015.

  1. PhilipBrown

    PhilipBrown Active Member Licensed User

    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?
  2. DonManfred

    DonManfred Expert Licensed User

    Raise an event from within the inline java when the callback is raised
  3. little3399

    little3399 Active Member Licensed User

    It there a sample for this ?
  4. DonManfred

    DonManfred Expert Licensed User

    Search the forum. There are a lot

    And crawl this... There are a lot of useful infos.
  5. PhilipBrown

    PhilipBrown Active Member Licensed User

    Thanks very much for this suggestion. It seems like the right solution, but I'm getting an error. My code is

    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

    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.
  6. Erel

    Erel Administrator Staff Member Licensed User

    (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:
  7. PhilipBrown

    PhilipBrown Active Member Licensed User

    That works. Thanks very much.