#1: Never Inject Contexts into ViewModels - Android Interviews

Опубликовано: 05 Апрель 2026
на канале: TL;DR Android
2,440
86

When it comes to ViewModels in Android, there are a few rules that you need to abide by to prevent your app from having memory leaks. This video explains why ViewModels shouldn't ever have a context injected into them, and how to overtime this requirement, should it be necessary.

---------

#android #viewmodel #context #programming #bestpractice #lifecycle #memoryleak

Studio setup:

** Cameras **
🎥 Sony Alpha ZV-E10: https://go.oliverspryn.com/sony-zv-e10

** Lenses **
🎥 Sony FE 20mm F1.8 G Full-Frame Lens: https://go.oliverspryn.com/sony-fe-20...

** Software **
🖥 Adobe Premiere Pro: https://go.oliverspryn.com/adobe-prem...
🖥 TechSmith® Snagit®: https://go.oliverspryn.com/techsmith-...

** Sounds, Stock video, and Templates **

🎥 Envato Elements: https://go.oliverspryn.com/envato-ele...