Search code examples
androidrealm

Realm ChangeListener for when objects of a type are added, not there contents changing


Is it possible to use a Realm ChangeListener to only be notified when an RealmObject has been removed or added from a Realm, and NOT therefore be notified if an RealmObjects properties has changed?

Example: I have an app that keeps track of Trucks owned, I want the Realm to Notify me when a Truck has been added or removed but not if the Truck has just been given new tires.


Solution

  • Currently that is not possible. You will get notified about all changes. We are working fine-grained notifications that will allow this, but we do not have a timeline yet: https://github.com/realm/realm-java/issues/989