Android realm Java – how to maintain item order when querying multiple IDS?

When I am using realm for Android 1.2.0 and querying multiple IDS:

query.in(Constants.ID, arraysOfIdsString);

The results will not be returned in the order given in the array. Is this a domain error? Can I keep the order of IDS and the order of returned elements in some way?

resolvent:

You can specify the sort order when executing the query:

query.int(Constants.ID,arrayOfIdString).findAllSorted(Constants.ID,Sort.DESC);

Unfortunately, this is not possible if the list of IDS in the array is different from the list that can be achieved by sorting ASC or desc

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>