Most visited

Recently visited

BaseObservable

public class BaseObservable
extends Object implements Observable

java.lang.Object
   ↳ android.databinding.BaseObservable
Known Direct Subclasses
Known Indirect Subclasses


实现 Observable接口并提供 notifyPropertyChanged(int)notifyChange()方法的便利类。

Summary

Public constructors

BaseObservable()

Public methods

void addOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)

添加回调以侦听对Observable的更改。

void notifyChange()

通知侦听器此实例的所有属性都已更改。

void notifyPropertyChanged(int fieldId)

通知侦听器特定属性已更改。

void removeOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)

从收听更改的人员中删除回调。

Inherited methods

From class java.lang.Object
From interface android.databinding.Observable

Public constructors

BaseObservable

BaseObservable ()

Public methods

addOnPropertyChangedCallback

void addOnPropertyChangedCallback (Observable.OnPropertyChangedCallback callback)

添加回调以侦听对Observable的更改。

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

notifyChange

void notifyChange ()

通知侦听器此实例的所有属性都已更改。

notifyPropertyChanged

void notifyPropertyChanged (int fieldId)

通知侦听器特定属性已更改。 更改的属性的吸气剂应标记为Bindable以在BR生成一个用作fieldId

Parameters
fieldId int: The generated BR id for the Bindable field.

removeOnPropertyChangedCallback

void removeOnPropertyChangedCallback (Observable.OnPropertyChangedCallback callback)

从收听更改的人员中删除回调。

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

Hooray!