Sudhir Singh Khanger
07/03/2021, 8:51 AMLiveData
object returns a non-null type would it at all trigger an observer's onChange()
if there is no data to be served?
val someLiveData: LiveData<List<String>> = ...
val someObserver = { someValue: String ->
// Will this return only if there is non-null data in someLiveData
}
B. Same case as above except the observer class expects a nullable type. So if LiveData
returns non-null type but the observer object expects a nullable type then would we get a null value when there's nothing to be returned?
val someLiveData: LiveData<List<String>> = ...
val someObserver = { someValue: String? ->
// Will this return null value from a non-null LiveData
}
Adam Powell
07/03/2021, 2:23 PMAdam Powell
07/03/2021, 2:23 PMgetValue
but it will not dispatch a null to newly registered observers