Search code examples
androidrealm

How to convert RealmResults object to RealmList?


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


Solution

  • RealmList <Student> results = new RealmList<Student>();
    
    results.addAll(realmResultList.subList(0, realmResultList.size()));