Posted by: Pdfprep
Post Date: May 18, 2021
In our TeaViewModel class, that extends ViewModel, we have such method:
public LiveData<Tea> getTea() { return mTea;
}
An observer in our Activity (type of mViewModel variable in example is TeaViewModel) is set in this way:
mViewModel.getTea().observe(this, this::displayTea);
What will be a correct displayTea method definition?
A . private void displayTea()
B . private void displayTea(Tea tea)
C . private void displayTea(LiveData<Tea>)
D . private void displayTea(LiveData<T>)
Answer: B
Leave a Reply