mViewModel!!.tea.observe(this, Observer { tea: Tea?
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 TeaViewModel) 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>)
Answer: B
Latest Associate Android Developer Dumps Valid Version with 107 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments