Display Data from two Realm Models in one View


#1

Hi,
i am trying to achive a display of data from two different Models in one Recyclerview and fail (Realm Java 5.7.0).

Example:

public class Email extends RealmObject {
private String address;
private long NoOfEmail; // highest value is latest Email
private long cid; // Child ID
}

public class Contact extends RealmObject {
private String name;
private long pid; // Parent ID
private RealmList myEmail; // Declare one-to-many relationships
}

How to:

make a relationship between “pid” and “cid”
Get “cid” with higest value
combine these results into one “RealmResults of Contact” to show in a recylerview

Many Thanks in advance for any support