Jacob Ferrero Jacob Ferrero - 2 months ago 3x
Android Question

Realm - How to build a feed with multiple types of objects?

I'm trying to use Realm to build a feed for my app. I want the feed to include everything new: posts, comments, events, and other things I have in my app.

I have these all defined as POJOs that extend

, and they all have a
property, however I can't find a way to query the whole Realm for objects sorted by their
. Is there any way to do that?


Unfortunately realm does not support polymophism/inheritance in realm objects. You can easily loop through each data set and merge them together according to createdAt. Using DynamicRealm this can be easily done.