Quiz Yourself on ViewModel Pattern

Test your understanding of the ViewModel.

Quiz on ViewModels.

1

What is not a reason we would need a custom ViewModelProvider.Factory?

A)

We need to create an instance of a ViewModel.

B)

If we’veve added arguments in the constructor of our ViewModel, then we must create a custom ViewModelProvider.Factory to create an instance for our ViewModel.

C)

We need to pass LiveData to be observed by the activity or fragment.

D)

We need to initialize the ViewModel to help pass our arguments in the activity or fragment.

Question 1 of 40 attempted