SDK
SDK Android v3.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

addListener #

Adds a listener to an event. When an event is fired, listeners are called in the order that they are added.


addListener(event, listener) #

ArgumentsTypeDescription
eventstringOne of the event described in the Event Handling section of this documentation
listenerfunctionThe function to call each time one of the registered event is fired

Return Value #

Returns the Kuzzle object to allow chaining.

Usage #

EventListener eventListener = new EventListener() {
  @Override
  public void trigger(Object... args) {
    // Actions to perform when receiving a 'subscribed' global event
  }
};
kuzzle.addListener(Event.connected, eventListener);