public
class
BaseObservable
extends Object
implements
Observable
java.lang.Object | |
↳ | android.databinding.BaseObservable |
Known Direct Subclasses |
Known Indirect Subclasses
ObservableParcelable<T extends Parcelable>
|
A convenience class that implements Observable
interface and provides
notifyPropertyChanged(int)
and notifyChange()
methods.
Public constructors | |
---|---|
BaseObservable()
|
Public methods | |
---|---|
void
|
addOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)
Adds a callback to listen for changes to the Observable. |
void
|
notifyChange()
Notifies listeners that all properties of this instance have changed. |
void
|
notifyPropertyChanged(int fieldId)
Notifies listeners that a specific property has changed. |
void
|
removeOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)
Removes a callback from those listening for changes. |
Inherited methods | |
---|---|
From
class
java.lang.Object
| |
From
interface
android.databinding.Observable
|
BaseObservable ()
void addOnPropertyChangedCallback (Observable.OnPropertyChangedCallback callback)
Adds a callback to listen for changes to the Observable.
Parameters | |
---|---|
callback |
Observable.OnPropertyChangedCallback :
The callback to start listening.
|
void notifyChange ()
Notifies listeners that all properties of this instance have changed.
void notifyPropertyChanged (int fieldId)
Notifies listeners that a specific property has changed. The getter for the property
that changes should be marked with Bindable
to generate a field in
BR
to be used as fieldId
.
Parameters | |
---|---|
fieldId |
int :
The generated BR id for the Bindable field.
|
void removeOnPropertyChangedCallback (Observable.OnPropertyChangedCallback callback)
Removes a callback from those listening for changes.
Parameters | |
---|---|
callback |
Observable.OnPropertyChangedCallback :
The callback that should stop listening.
|