🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
[ Ссылка ]
🐱👤 Wanna become a member? Join!
[ Ссылка ]
📸 Instagram
[ Ссылка ]
So far you might got used on having a single ViewModel instance per Fragment? So when you regularly instantiate one ViewModel in your Fragment, it's often scoped to a lifecycle of your Fragment, right? And by scoping that one ViewModel to a single Fragment you cannot share values between multiple Fragments. Which make sense.
In order to Share values from the same ViewModel instance between
multiple Fragments, you need to scope ViewModel to an Activity instead. Watch the video to learn more about it.
ViewModel - Explained: [ Ссылка ]
ViewModel Factory: [ Ссылка ]
🕒 Timestamps:
0:00 - Introduction
2:08 - About the project
2:46 - Create Shared ViewModel
4:50 - Let's Start
Ещё видео!