Realm query for latest record for each user

Tags: java realm
By : Michael

How would I accomplish a similar query in realm java like that one asked in this question: how do I query sql for a latest record date for each user Cause it seems realm lacks a group by method when fetching queries

Here's my RealmObject:

public class Memo extends RealmObject {
    public static final int SENT = 1;
    public static final int UNREAD = 2;
    public static final int READ = 3;
    public static final int PENDING = 4;
    private static final String TAG = Memo.class.getName();
    public String id = "";
    public String connection = "";
    public String subject = "";
    public String body = "";
    public int status = 0;
    public Date date;
    public Boolean sentByMe = false;
    public String remoteId = "";
    public Boolean isFile = false;
    public String filepath = "";

This represents the user:

public String connection
By : Michael

Sign up using Google

This video can help you solving your question :)
By: admin