Saman Mohamadi
Saman Mohamadi

Reputation: 4662

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?

Upvotes: 1

Views: 304

Answers (1)

Christian Melchior
Christian Melchior

Reputation: 20126

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.

Upvotes: 3

Related Questions