ViewModel in Activity Under the Hood: How It Survives Recreation
What actually happens to ViewModel when Activity is destroyed and recreated? We break down the entire chain: ViewModelStore, NonConfigurationInstances, ActivityThread, and ActivityClientRecord. We show in detail where and how state is stored, and how Android magically restores everything during configuration changes.