VM 3 How to create ViewModel with parameterized constructor ViewModelProvider.Factory | Android

Опубликовано: 08 Июнь 2026
на канале: AndroidDevSunny
2,731
61

In this video we will learn how to create a Viewmodel with parameterized constructor. by default ViewModel is created by ViewModelProvider using it's default constructor, so for creating a ViewModel with parameterized constructor we need to create Instance of ViewModelProvider.Factory and override it's create method and then pass that factroy to ViewModelProvider.


Don't forget to subscribe to the channel for quality tutorial videos on android application development.

Connect with AndroidDevSunny on other social media Platforms to get latest updates:
Facebook:   / androiddevsunny  
Twitter:   / androiddevsunny  
Instagram:   / androiddevsunny