Solved

In Our TeaViewModel Class, That Extends ViewModel , We Have

Question 1

Multiple Choice

In our TeaViewModel class, that extends ViewModel , we have such prorerty: val tea: LiveData<Tea> An observer in our Activity (type of mViewModel variable in example is ) is set in this way: mViewModel!!. tea .observe(this, Observer { tea: Tea? -> displayTea(tea) } ) What will be a correct displayTea method definition?


A) private fun displayTea()
B) private fun displayTea(tea: Tea?)
C) private fun displayTea(tea: LiveData?<Tea>)
D) private fun displayTea(tea: LiveData?<T>)

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents