Skip to content

Conversation

RemiLatapy
Copy link

Allow LiveData to stay up to date, especially when resuming an activity

It solves this issue: https://stackoverflow.com/questions/49981734/observer-for-android-livedata-not-called-but-it-is-with-observeforever

Allow LiveData to stay up to date, especially when resuming an activity
Copy link
Contributor

@cmelchior cmelchior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @RemiLatapy
Thank you for doing this 👏

I tested this and it looks like calling it here is correct vs. the constructor as it currently does. However, if we just merge this it will actually set the same value twice when constructing the LiveData, which we want to avoid.

If you remove the call to setValue() in the constructor I think we can merge this.

Also, it looks like you need to sign our CLA: https://github.com/realm/realm-java/blob/master/CONTRIBUTING.md#cla

Copy link
Author

@RemiLatapy RemiLatapy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes to avoid double call

@bmunkholm
Copy link
Contributor

@cmelchior Looks like this needs another review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants