As the title suggest, I can't get a onChange listener to get called.
I have a listener reference as an attribute in a class like that:
private RealmChangeListener m_listener = new RealmChangeListener<RealmList<RLMChat>>()
public void onChange(RealmList<RLMChat> t)
At the beginning of the activity, I assign it that way to listen for any item added to this list:
final RLMChannel channel = RealmUtils.sharedInstance().getRealmPersistent().where(RLMChannel.class).equalTo(Constants.KEY_M_ID, this.m_channel_id).findFirst();
if (channel != null)
RealmUtils.sharedInstance().getRealmPersistent() returns a singleton instance of the realm aim at being used on the UI-Thread.
I use FCM to update this list of chats on a background thread when I receive a new chat.
The issue is the listener that was assigned on the UI-Thread never gets called. I think I am missing something obvious...but I believed the point was to be able to update a realm on a background thread, and get the onChange callback on the UI-Thread to update accordingly.
Please help haha. Sorry if I am missing something obvious here