-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChangeListener no longer triggered on a findFirstAsync, after delete #4360
Comments
So what you're trying to accomplish is: 0.) insert item into Realm (please note I am not an official Realm person) This is probably due to some difference in semantics compared to a PendingRow (which represents the query to a particular Row as in an actual Object) versus a Collection/Results (which represents a list of Rows that satisfy the query). It seems to me that You should probably switch to Just today I was thinking about how odd it is that |
When When the object gets deleted, the listener will be called the last time. After that, the listener won't be triggered anymore. This works as design. So, you could:
We will add more javadoc about this. |
Thanks for replying - seeing that we always have one (or zero) |
(Sorry, closed too fast / reopened, seeing you want to update the documentation) |
Truth be told, me as an outsider, I'm honestly not sure when the Honestly I use
|
Goal
I have a single Token object, that I need to insert/update/delete and be notified every time this happens.
Here's what I do:
Note: I confirmed by using Realm Browser that the insert really worked.
Expected Results
I should be called.
Actual Results
On insertion after the delete, the listener is not triggered
Steps & Code to Reproduce
FYI: If I change my
mTokenObservable
to a list and usefindAll
instead offindFirstAsync
, this works.Code Sample
See above.
Version of Realm and tooling
Realm version(s): 3.0.0
Realm sync feature enabled: no
Android Studio version: Android Studio 2.4 Preview 2 Build #AI-171.3804685, built on March 15, 2017
Which Android version and device: Emulator API 23
The text was updated successfully, but these errors were encountered: