Skip to content

Most visited

Recently visited

navigation

Observable

public interface Observable

android.databinding.Observable
Known Indirect Subclasses


Observable classes provide a way in which data bound UI can be notified of changes. ObservableList and ObservableMap also provide the ability to notify when changes occur. ObservableField, ObservableParcelable, ObservableBoolean, ObservableByte, ObservableShort, ObservableInt, ObservableLong, ObservableFloat, and ObservableDouble provide a means by which properties may be notified without implementing Observable.

An Observable object should notify the Observable.OnPropertyChangedCallback whenever an observed property of the class changes.

The getter for an observable property should be annotated with Bindable.

Convenience class BaseObservable implements this interface and PropertyChangeRegistry can help classes that don't extend BaseObservable to implement the listener registry.

Summary

Nested classes

class Observable.OnPropertyChangedCallback

The callback that is called by Observable when an observable property has changed. 

Public methods

abstract void addOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)

Adds a callback to listen for changes to the Observable.

abstract void removeOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)

Removes a callback from those listening for changes.

Public methods

addOnPropertyChangedCallback

void addOnPropertyChangedCallback (Observable.OnPropertyChangedCallback callback)

Adds a callback to listen for changes to the Observable.

Parameters
callback Observable.OnPropertyChangedCallback: The callback to start listening.

removeOnPropertyChangedCallback

void removeOnPropertyChangedCallback (Observable.OnPropertyChangedCallback callback)

Removes a callback from those listening for changes.

Parameters
callback Observable.OnPropertyChangedCallback: The callback that should stop listening.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

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.