How to convert RealmResults object to RealmList?

Ezio123 picture Ezio123 · May 8, 2015 · Viewed 20k times · Source

I have a RealmResults <Student> object. I want to convert it to RealmList <Student> object. any suggestions?

Answer

ChaturaM picture ChaturaM · May 8, 2015
RealmList <Student> results = new RealmList<Student>();

results.addAll(realmResultList.subList(0, realmResultList.size()));