android.databinding
Interface ObservableList<T>

All Superinterfaces:
java.util.Collection<T>, java.lang.Iterable<T>, java.util.List<T>

public interface ObservableList<T>
extends java.util.List<T>

A List that notifies when changes are made. An ObservableList bound to the UI will keep the it up-to-date when changes occur.

The ObservableList must notify its callbacks whenever a change to the list occurs, using ObservableList.OnListChangedCallback.

ObservableArrayList implements ObservableList with an underlying ArrayList. ListChangeRegistry can help in maintaining the callbacks of other implementations.

See Also:
Observable, ObservableMap

Nested Class Summary
static class ObservableList.OnListChangedCallback<T extends ObservableList>
          The callback that is called by ObservableList when the list has changed.
 
Method Summary
 void addOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
          Adds a callback to be notified when changes to the list occur.
 void removeOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
          Removes a callback previously added.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

addOnListChangedCallback

void addOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
Adds a callback to be notified when changes to the list occur.

Parameters:
callback - The callback to be notified on list changes

removeOnListChangedCallback

void removeOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
Removes a callback previously added.

Parameters:
callback - The callback to remove.