The Wayback Machine - https://web.archive.org/web/20170327101408/https://developer.android.com/reference/android/databinding/ObservableList.html
Skip to content

Most visited

Recently visited

navigation

ObservableList

public interface ObservableList
implements List<T>

android.databinding.ObservableList<T>
ImageKnown Indirect Subclasses


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:

Summary

Nested classes

class ObservableList.OnListChangedCallback<T extends ObservableList>

The callback that is called by ObservableList when the list has changed. 

Public methods

abstract void addOnListChangedCallback(OnListChangedCallback<? extends ObservableList<T>> callback)

Adds a callback to be notified when changes to the list occur.

abstract void removeOnListChangedCallback(OnListChangedCallback<? extends ObservableList<T>> callback)

Removes a callback previously added.

Inherited methods

ImageFrom interface java.util.List
ImageFrom interface java.util.Collection
ImageFrom interface java.lang.Iterable

Public methods

addOnListChangedCallback

void addOnListChangedCallback (OnListChangedCallback<? extends ObservableList<T>> callback)

Adds a callback to be notified when changes to the list occur.

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

removeOnListChangedCallback

void removeOnListChangedCallback (OnListChangedCallback<? extends ObservableList<T>> callback)

Removes a callback previously added.

Parameters
callback OnListChangedCallback: The callback to remove.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.