ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 72 - Associate Android Developer discussion

Report
Export

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()
Answers
A.
private void displayTea()
B.
private void displayTea(Tea tea)
Answers
B.
private void displayTea(Tea tea)
C.
private void displayTea(LiveData<Tea>)
Answers
C.
private void displayTea(LiveData<Tea>)
D.
private void displayTea(LiveData<T>)
Answers
D.
private void displayTea(LiveData<T>)
Suggested answer: B
asked 18/09/2024
Gabriel Paschoalatto
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first