diff --git a/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmObject.java b/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmObject.java index 97690d596fd..58ce10ffcec 100644 --- a/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmObject.java +++ b/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmObject.java @@ -87,6 +87,7 @@ protected void onActive() { super.onActive(); T object = getValue(); if (object != null && RealmObject.isValid(object)) { + setValue(object); RealmObject.addChangeListener(object, listener); } } diff --git a/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmResults.java b/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmResults.java index 8b54563cec6..1aebb8e7c64 100644 --- a/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmResults.java +++ b/examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/livemodel/LiveRealmResults.java @@ -77,6 +77,7 @@ public LiveRealmResults(@NonNull RealmResults results) { protected void onActive() { super.onActive(); if (results.isValid()) { // invalidated results can no longer be observed. + LiveRealmResults.this.setValue(results); results.addChangeListener(listener); } }