Prevent ROOM tracker from looping

This commit is contained in:
M66B
2019-07-28 15:49:06 +02:00
parent abbd89eece
commit 9f1f446210
2 changed files with 16 additions and 5 deletions

View File

@@ -93,6 +93,8 @@ class RoomTrackingLiveData<T> extends LiveData<T> {
//throw new RuntimeException("Exception while computing database"
// + " live data.", e);
computed = false;
mInvalid.set(false);
break;
}
}
if (computed) {
@@ -127,6 +129,7 @@ class RoomTrackingLiveData<T> extends LiveData<T> {
}
}
};
@SuppressLint("RestrictedApi")
RoomTrackingLiveData(
RoomDatabase database,