Skip to content

Commit

Permalink
Update LiveData value when becoming active
Browse files Browse the repository at this point in the history
Allow LiveData to stay up to date, especially when resuming an activity
  • Loading branch information
RemiLatapy committed Nov 15, 2018
1 parent 314d9af commit 2b555bb
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ protected void onActive() {
super.onActive();
T object = getValue();
if (object != null && RealmObject.isValid(object)) {
setValue(object);
RealmObject.addChangeListener(object, listener);
}
}
Expand Down

0 comments on commit 2b555bb

Please sign in to comment.