Q 1. You want to use the MVVM architecture pattern in your application. You are using Data Binding and ViewModel architecture components. You have the field "favorite" in your ViewModel class provided with required getters and setters. You would like to implement two-way data binding: avoid calling viewModel method onFavoriteChanged() when the checked status changes in UI. You have prepared the ViewModel class for two-way data binding for "favorite" field and provided your ViewModel instance to Data Binding in the layout. How should you bind your ViewModel to UI in such a way that two-way data binding would work?
Q 2. You want to use Data Binding component in your Android Application. You have an activity displaying a list of items and you would like to bind the list to your layout. Your list has type java.util.List. Which of the following XML snippets contain the correct way of setting List as a data source in data binding? Please choose the option with only the required code included.