Is it possible to add standalone objects to a RealmList of an RealmObject already persisted in a realm?
Well, I know it doesnt work, because I get NPEs at (object.row.getIndex():RealmList:94
)
What I want to do is:
mRealm.beginTransaction;
contact.getEmails().add(new Email());
mRealm.commitTransaction;
Because at that specific moment I dont have access to a Realm (well I could make it work, but I would have to rewrite some structures), for example:
//In Activity
Contact contact = Realm.where(Contact.class).equalsTo("name","pete").findAll().first();
mRealm.beginTransaction;
UpdateHelper.update(contact);
mRealm.commitTransaction;
//Helper class some else package
public static void update(Contact contact) {
//do update stuff
contact.getEmails().add(new Email());
}
`