Whenever possible, you should be using string resources to make sure your app can easily be translated to other languages. However to read a string resource, you need access to the context which you don't have in ViewModels. In this video I show you how you can solve this problem.
Get limited 20% discount on all my courses using the code HAPPY-EASTER:
https://pl-coding.com/premium-courses...
💻 Let me personally review your code and provide individual feedback, so it won't backfire and cost you a fortune in future:
https://elopage.com/s/philipplackner/...
🎓 Become an industry-ready developer in the Mobile Dev Campus:
https://pl-coding.com/campus?utm_sour...
🎁 Get my FREE 4.5h course "The Best Practice Guide to Android Architecture":
https://pl-coding.com/best-practice-g...
Read our weekly Android blog:
https://pl-coding.com/blog
Join this channel to get access to perks:
/ @philipplackner
Get the initial source code for this video here:
https://github.com/philipplackner/Uni...
Get the final source code here:
https://github.com/philipplackner/Uni...
Join my Discord server:
/ discord
Regular programming advice on my Instagram page: / _philipplackner_
Checkout my GitHub: https://github.com/philipplackner
You like my free content? Here you can buy me a coffee:
https://www.buymeacoffee.com/philippl...
Sur cette page du site, vous pouvez voir la vidéo en ligne How to Use String Resources In a ViewModel - Android Studio Tutorial durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Philipp Lackner 13 avril 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 44,823 fois et il a aimé 1.5 mille téléspectateurs. Bon visionnage!