Package io.realm
Interface RealmChangeListener<T>
-
- Type Parameters:
T- The live object being returned (Realm,DynamicRealm,RealmObject,RealmResults,DynamicRealmObjector your model implementingRealmModel)
public interface RealmChangeListener<T>RealmChangeListener can be registered with aRealm,RealmResultsorRealmObjectto receive a notification about updates.When registered against a
Realmyou'll get notified when a Realm instance has been updated. Register against aRealmResults,RealmList,RealmDictionaryorRealmObjectto only get notified about changes to them.Realm instances on a thread without an
Loopercannot register a RealmChangeListener.All
RealmObjectandRealmResultswill automatically contain their new values when theonChange(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 usingRealmObject.isValid().
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonChange(T t)Called when a transaction is committed.
-
-
-
Method Detail
-
onChange
void onChange(T t)
Called when a transaction is committed.
-
-