Shared-ViewModel-sample
Shared-ViewModel-sample copied to clipboard
This repo is to demonstrate how to use shared ViewModel
Shared ViewModel Sample
How to communicate between fragments and activity?
Before ViewModel
the best way was to use interface to communicate or pass date between fragments and activity. But, now we can use ViewModel
and it will be very easy. We just need to create the ViewModel in activity scope and thats it. Just observer the ViewModel. This is a sample project to show the Shared ViewModel
implemneteation.
Tutorial and related article on medium.