Android ViewModel and ViewModel Factory Tutorial for Beginners with Example

preview_player
Показать описание
A simple beginner-friendly walkthrough of how to implement a ViewModel and a ViewModel Factory for a #kotlin #android app.

Consider Subscribing 🤩

Chapters:
00:00 Intro
00:15 What is a ViewModel?
01:22 Example app walkthrough
04:36 Add dependencies
05:11 Implement first ViewModel
12:18 Implement second ViewModel
14:49 Implement ViewModelFactory

GitHub Repository

Google's Official Documentation on ViewModels:

One line method for creating ViewModel Factory:

Awesome Tutorial by Lyla Fujiwara:

-----
The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
Рекомендации по теме
Комментарии
Автор

thnx for the video.. but im not able to add my factory as a parameter inside the viewModelProvider.. "None of the following functions can be called with the arguments supplied" this is what the error message is.. can you please help?

lucatae
Автор

Great video can you make one on Couroutines please?

ahmadxrizvi
join shbcf.ru