I have a RealmResults <Student>
object. I want to convert it to RealmList <Student>
object. any suggestions?
RealmList <Student> results = new RealmList<Student>();
results.addAll(realmResultList.subList(0, realmResultList.size()));
Please try and let me know if this work for you.
RealmList <Student> finalList = new RealmList<Student>();
finalList.addAll(yourRealmResults.subList(0, yourRealmResults.size()));
RealmResults
implements the List
interface and so does the RealmList
.
RealmList <Student> results = new RealmList<Student>();
results.addAll(realmResultsList);
Since 0.87.0
- Added Realm.copyFromRealm() for creating detached copies of Realm objects (#931).
Which allow just return list List<E extends RealmObject>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With