Blog131.5K views2,642 votes0 replies2,356 following
Stop Losing UI State on Rotation: ViewModel and LiveData Done Right
Activities get destroyed on rotation and take your UI state with them. Here's how ViewModel + LiveData fixes that, with a working counter example and three ways to verify the lifecycle behavior yourself.