Skip to content

Unconditional Delivery Listeners

The where clause argument in the addUpdateListener method is optional. When it is not provided, the real-time database will deliver any object  which is being updated in the database's table:

EventHandler<Map> orderEventHandler = Backendless.Data.of( "Order" ).rt();

orderEventHandler.addUpdateListener( new AsyncCallback<Map>()
{
  @Override
  public void handleResponse( Map updatedOrder )
  {
    Log.i( "MYAPP", "an Order object has been updated. Object ID - " + updatedOrder.get( "objectId" ) );   
  }

  @Override
  public void handleFault( BackendlessFault fault )
  {
    Log.e( "MYAPP", "Server reported an error " + fault.getDetail() );
  }
} );
EventHandler<Order> orderEventHandler = Backendless.Data.of( Order.class ).rt();

orderEventHandler.addUpdateListener( new AsyncCallback<Order>()
{
  @Override
  public void handleResponse( Order updatedOrder )
  {
    Log.i( "MYAPP", "an Order object has been updated. Object ID - " + updatedOrder.objectId );
  }

  @Override
  public void handleFault( BackendlessFault fault )
  {
    Log.e( "MYAPP", "Server reported an error " + fault.getDetail() );
  }
} );