Skip to content

Unconditional Delivery Listeners

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

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

orderEventHandler.addDeleteListener( new AsyncCallback<Map>()
{
  @Override
  public void handleResponse( Map deletedOrder )
  {
    Log.i( "MYAPP", "an Order object has been deleted. Object ID - " + deletedOrder.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.addDeleteListener( new AsyncCallback<Order>()
{
  @Override
  public void handleResponse( Order deletedOrder )
  {
    Log.i( "MYAPP", "an Order object has been deleted. Object ID - " + deletedOrder.objectId );
  }

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