Updated AndroidX

This commit is contained in:
M66B
2022-05-11 20:03:58 +02:00
parent 6fb004eacd
commit 25babe4f41
8 changed files with 44 additions and 10 deletions

View File

@@ -83,6 +83,9 @@ public class MediatorLiveData<T> extends MutableLiveData<T> {
*/
@MainThread
public <S> void addSource(@NonNull LiveData<S> source, @NonNull Observer<? super S> onChanged) {
if (source == null) {
throw new NullPointerException("source cannot be null");
}
Source<S> e = new Source<>(source, onChanged);
Source<?> existing = mSources.putIfAbsent(source, e);
if (existing != null && existing.mObserver != onChanged) {