我在我的应用程序中遇到此问题,2个后续查询,第一个同步和第二个异步返回给我不同的结果
try (Realm realm = Realm.getDefaultInstance()) {
App appRealm = realm.where(App.class).findFirst();
RealmList<CookieRealm> cookies0 = appRealm.getCookies(); <--Here cookies0 size is 0
realm.where(App.class).findFirstAsync().<App>asObservable()
.filter(app -> app.isLoaded())
.first()
.subscribe(app -> {
RealmList<CookieRealm> cookies = app.getCookies(); <--Here cookies size is 2
});
}
怎么可能?查询有问题吗?
Realm版本是2.1.1