Search code examples
androidrealm

How convert RealmList to ReamResult


I want use RealmList in a RealmBaseAdapter but it only accepts RealmResult. How can I convert RealmList to a RealmResult?


Solution

  • Currently you would have to do something like this

    realmList.where().findAll()
    

    However we want to add a shared interface between the two making this easier. You can follow progress on that here: https://github.com/realm/realm-java/issues/1363

    Edit: From Realm Java 3.0.0 and Realm Android Adapters 2.0.0, this is no longer an issue, and RealmBaseAdapter works for both RealmList and RealmResults.