java.util.ConcurrentModificationException
No outside changes to a Realm is allowed while iterating a RealmResults. Use iterators methods instead.
here's the logic:
for(RealmObject object : RealmResults) {
realm.beginTransaction();
object.setProperty(newValue);
realm.commitTransaction();
}
Please correct me if i'm wrong, but on the docs says that i can modify the elements:
A RealmResults list contains a list of objects of a given type that matches the query. The objects are not copied from the Realm to the RealmResults list, but just references the original objects. This preserves memory and increase speed. It also implies that any modification to any object in a RealmResults is reflected in the objects in the Realm that was queried. Updates to objects must be done within a transaction and the modified object is persisted to the backing Realm file during the commit of the transaction.
I need help asap as i'm working on a project, using realm and trying to get it on production in 2 weeks.
--
You received this message because you are subscribed to the Google Groups "Realm Java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-java+...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-java/a11f1868-f447-4b27-a91c-ca6d3edfb732%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Realm Java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-java+...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-java/cae1f9c1-bcf2-4df0-a05b-46e6bc78b6b6%40googlegroups.com.