Shared ViewModel - Explained | Android Studio Tutorial

Publié le: 01 mars 2021
sur la chaîne: Stevdza-San
44,605
1.2k

🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
https://stevdza-san.com

🐱‍👤 Wanna become a member? Join!
   / @stevdzasan  

📸 Instagram
  / stevdza_san  


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 Explained - Android Archite...  
ViewModel Factory:    • ViewModel Factory Explained - Android...  

🕒 Timestamps:
0:00 - Introduction
2:08 - About the project
2:46 - Create Shared ViewModel
4:50 - Let's Start


Sur cette page du site, vous pouvez voir la vidéo en ligne Shared ViewModel - Explained | Android Studio Tutorial durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Stevdza-San 01 mars 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 44,605 fois et il a aimé 1.2 mille téléspectateurs. Bon visionnage!