In the Jetpack Compose December '25 release (version 1.10), Google introduced a game-changing API: retain. For years, we've been forced to create entire ViewModels just to keep a simple object like an ExoPlayer instance or a complex Bitmap alive across screen rotations.
In this video, I’ll show you how to use retain to simplify your architecture, when to use it instead of rememberSaveable.
📂 Source Code: https://github.com/Hoodlab/Yt_tutorial
Master Android App Development with jetpack compose and kotlin:
https://www.udemy.com/course/android-development-with-kotlin-and-jetpack-compose/?referralCode=1C191D33FAB7AD24130E
What you will learn:
Why remember isn't enough for configuration changes.
The specific gap retain fills between remember and ViewModel.
Live Coding: Building a rotation-proof Video Player in 5 minutes.
Download
0 formats
No download links available.
Stop Overusing ViewModels: The New retain API Explained | NatokHD