ASSOCIATE-ANDROID-DEVELOPER practice question 12 of 25

LiveData.postValue() and LiveData.setValue() methods have some differences. So if you have a following code executed in the main thread: liveData.postValue("a"); liveData.setValue("b"); What will be the correct statement?

Full set: 128 questions
Answer options
A: The value "b" would be set at first and later the main thread would override it with the value "a".
B: The value "a" would be set at first and later the main thread would override it with the value "b". Correct answer
C: The value "b" would be set at first and would not be overridden with the value "a".
D: The value "a" would be set at first and would not be overridden with the value "b".
Correct Answer:
B. The value "a" would be set at first and later the main thread would override it with the value "b".
Scroll to Top