On

Description

This methods lets you bind a function to execute/run when a new event is recieved.

Params

The arguments that this function accepts are the following:

  • event

    • Description

      • Its a mandatory field that contains the event you want to bind your function to.

    • Data Type

      • String

    • Types of Events

      • message

  • WidgetEventListener

    • Description

      • Its a mandatory field that expects and instance of class WidgetEventListener that has the method public void run(String data)

        who will be executed each that a new event is created.

    • Data Type

      • ai.jelou.widget.WidgetEventListener;

Example of Use

widgetService.on("<event>", new WidgetEventListener() {
    @Override
    public void run(String data) {
        // Here Goes Your Code
    }
}

Last updated