Wrap/unwrap through Parcel library a RealmList inside one RealmObject within another RealmObject

127 views Asked by At

I have a RealmObject which contains for example these fields:

@PrimaryKey
String id;

JustRealmObject justRealmObject;

@ParcelPropertyConverter(SomeRealmObjectParcelConverter.class)    
RealmList<SomeRealmObject> someRealmObjects;

ProblemRealmObject problemObject;

And with the first 3 fields everything is fine, they're wrapping and unwrapping as should when I pass the main RealmObject to another activity in an intent.

A ProblemRealmObject has next fields:

@PrimaryKey
String name;

@ParcelPropertyConverter(NeededRealmObjectParcelConverter.class)
RealmList<NeededRealmObject> neededRealmObjects;

And here I have a problem. The field name wraps/unwraps, but neededRealmObjects doesn't. I always get null when trying to get this list after unwrapping the main RealmObject. For a RealmList I use a RealmListParcelConverter and it works great if RealmList is inside the the main RealmObject, but it's not even calling in the case when the RealmList is in the ProblemRealmObject within the main RealmObject...

How can I resolve that?

0

There are 0 answers