Interface RealmChangeListener
On this page
io.realm
RealmChangeListener can be registered with a Realm , RealmResults or RealmObject to receive a notification about updates.
When registered against a Realm
you'll get notified when a Realm instance has been updated. Register against a RealmResults
, RealmList
, RealmDictionary
or RealmObject
to only get notified about changes to them.
Realm instances on a thread without an android.os.Looper cannot register a RealmChangeListener.
All io.realm.RealmObject and io.realm.RealmResults will automatically contain their new values when the onChange(Object) method is called. Normally this means that it isn't necessary to query again for those objects, but just invalidate any UI elements that are using them. If there is a chance that a object has been been deleted, it can be verified by using RealmObject.isValid() .
Method Summary
Modifier and Type | Method and Description |
---|---|
public void | Called when a transaction is committed. |
Method Detail
onChange
Called when a transaction is committed. |