Realm-java: issue on realm 5.7.0 for android API Added Partial Query not reflect on cloudRealm Each time - mostly after 5 minute

Created on 25 Sep 2018  Â·  4Comments  Â·  Source: realm/realm-java

Goal

What do you want to achieve?

Expected Results

?

Actual Results

E.g. full stack trace with exception

Steps & Code to Reproduce

realmCollectionOrder listener not working or Live notification not happening

Code Sample

 public void attachRealmAsync(String id) {
db.where(MyEntity.class)
                    .equalTo(DataContract.MyEntry.COLUMN_Id, id)
                    .findAllAsync().addChangeListener(, new OrderedRealmCollectionChangeListener<RealmResults<MyEntity>>() {
                    @Override
                    public void onChange(RealmResults<MyEntity> myEntity, OrderedCollectionChangeSet changeSet) {
                        Timber.d("Entity Synced"+myEntity.size());
                        realmSyncChat_db.refresh();
                    }
                });
        }

Version of Realm and tooling

Realm version(s): 5.7.0

Realm sync feature enabled: yes

Android Studio version: 3.1.4

O-Community T-Help

Most helpful comment

All 4 comments

I assume it's because GC ate your RealmResults.

it means whenever i used GarbageCollection then i need to reattach RealmQuery Listener
and how i can prevent from it.

I assume the above solution solved your issue. If not, feel free to re-open the issue.

Was this page helpful?
0 / 5 - 0 ratings