Ajji
Ajji

Reputation: 3086

Empty RealmResult Object

I am having a scenario where i have an ArrayList of different ids. Now each id have more than one record in database, and the end result should be one list containing all the records of those ids. Is there any way i can combine them all in one RealmResult object?

I have two confusions here:

  1. When i try to initialize Realm result, i couldn't find its constructor. It says no default constructor found.
  2. AddAll method of RealmResult is deprecated.

Upvotes: 1

Views: 1594

Answers (1)

EpicPandaForce
EpicPandaForce

Reputation: 81539

RealmResults<MyObj> results = realm.where(MyObj.class).in("id", arrayList.toArray()).findAll();

Upvotes: 3

Related Questions