RealmQuery findAllAsync() not working
realm version: 3.1.4 i am trying to RealmQuery.findAllAsync after creating a realm insatanse,my table is very big arround 10K records + 10-20MB, some times the RealmChangeListener called and sometimes not, on debug mode in 90% of times it called, but in normal mode it dosent called at all.
You need to store the results as a field variable
Note you need to keep a reference to your RealmResults to avoid it being GC'ed. Most likely in a class variable:
public Foo {
private RealmResults<Bar> results;
private baz() {
results = realm.where(Bar.class).findAllAsync();
results.addChangeListener(listener);
}
}
If that is not your problem, you need to provide some code we can look at.
yes that is my problem, but why?, by the way there is nothing on the documentation about it...
It is on the website: https://realm.io/docs/java/latest/#notifications But we should probably also make it more clear in the Javadoc.
Closed by #4631