10 Questions and Answers about ViewModels in Android
10 часто задаваемых вопросов на собесах про ViewModel.
👉 What is a ViewModel?
👉 How does a ViewModel differ from an Activity or Fragment?
👉 How do I create a ViewModel?
👉 What is the purpose of a ViewModelFactory?
👉 How do ViewModels communicate with Activities or Fragments?
👉 Can ViewModels hold references to the Context?
👉 How do ViewModels handle configuration changes?
👉 Can I share data between multiple Fragments using a ViewModel?
👉 Can I test ViewModels?
👉 Can ViewModels replace the need for saving data in onSaveInstanceState()?
Читать (En)