Interface RealmObjectChangeListener<T extends RealmModel>
-
- Type Parameters:
T
- The type ofRealmModel
on which your listener will be registered.
public interface RealmObjectChangeListener<T extends RealmModel>
RealmObjectChangeListener
can be registered on aRealmModel
orRealmObject
to receive detailed notifications when an object changes.Realm instances on a thread without an
Looper
cannot register aRealmObjectChangeListener
.Listener cannot be registered inside a transaction.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onChange(T t, ObjectChangeSet changeSet)
When this gets called to return the results of an asynchronous query made byRealmQuery.findFirstAsync()
,changeSet
will benull
.
-
-
-
Method Detail
-
onChange
void onChange(T t, @Nullable ObjectChangeSet changeSet)
When this gets called to return the results of an asynchronous query made byRealmQuery.findFirstAsync()
,changeSet
will benull
.When this gets called because the object was deleted,
changeSet.isDeleted()
will returntrue
andchangeSet.getFieldChanges()
will returnnull
.When this gets called because the object was modified,
changeSet.isDeleted()
will returnfalse
andchangeSet.getFieldChanges()
will return the detailed information about the fields' changes.If a field points to another RealmObject this listener will only be triggered if the field is set to a new object or null. Updating the referenced RealmObject will not trigger this listener.
If a field points to a RealmList, this listener will only be triggered if one or multiple objects are inserted, removed or moved within the List. Updating the objects in the RealmList will not trigger this listener.
Changes to
LinkingObjects
annotatedRealmResults
fields will not be monitored, nor reported through this change listener.- Parameters:
t
- theRealmObject
this listener is registered to.changeSet
- the detailed information about the changes.
-
-