Closed demogorgorn closed 6 years ago
Hi @demogorgorn These sorts of questions are better suited for Stack Overflow that also has a bigger community for answering.
But you want to add a RealmChangeListener to your RealmResults
. This is e.g. what our RealmRecyclerViewAdapter
does: https://github.com/realm/realm-android-adapters/blob/master/adapters/src/main/java/io/realm/RealmRecyclerViewAdapter.java#L181
If you do it inside an activity or inside an adapter is really up to you as it depends a lot on the use case and general archicture of your app.
Should we use in activity/fragment RealmResult listener or we can do this using adapter. My case is to ypdate internal counters when item was added to realm.