realm-java: Main object not being notified when a "LinkingObjects" collection changes
Hello, I have the following structure (I only write down the relevant parts)
public class Parapet extends RealmObject
{
@PrimaryKey
publicString String UUID;
@LinkingObjects("parapet")
public final RealmResults<Letter> letters = null;
}
And the related class:
public class Letter extends RealmObject {
@PrimaryKey
publicString UUID;
public Parapet parapet;
public Contender contender;
}
And the last one:
public class Contender extends RealmObject
{
@PrimaryKey
publicString String UUID;
}
I have a parapet with 4 letters asociated. When I change one of the associated letters contender, the related parapet is not being notified (for example when I use a RealmResults of parapets as a source for a RecyclerViewAdapter I’m using realm 3.4.0. Before being a @LinkingObjects I had it as a RealmList<Letter> and it did notified.
I don’t know if with the new @LinkingObjects functionallity this kind of notificiations are not being raised anymore.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
@beender At the end I’m doing something like that. However with that implementation, the letter listener must know which parapet listener has to call. This means that in other places where the parapet are being listened, doesn’t know about the “change”. What I was asking is for a way to “touch” a RealmObject so all the listeners are being notified. I know that I can change a property on the parapet and that would trigger the change but seems a little dirty: