What is LayerChangeEventListener and what do I do with it?

LayerChangeEventListener is an interface that can ideally be implemented on a view. Once one of the static methods, onEventMainThread or onEventAsync, are implemented, you will then need to register the LayerChangeEventListener on the LayerClient as such:


Here's an example implementation of onEventMainThread:

public void onEventMainThread(LayerChangeEvent event) {
   List changes = event.getChanges();
   for (LayerChange change: changes) {
    switch (change.getChangeType()) {
       case INSERT:
       // Object was created
        System.out.println("Object was created.");

       case UPDATE:
       // Object was update
        System.out.println("Object was updated.");

       case DELETE:
       // Object was deleted
        System.out.println("Object was deleted.");
Have more questions? Submit a request