Sobes.tech
Junior — Middle

For what period of time does the ViewModel ensure the preservation of its state?

sobes.tech AI

Answer from AI

In Android, ViewModel preserves its state across configuration changes like rotation. It lives until the associated UI component (Activity/Fragment) is finished. It is destroyed when the component is permanently destroyed.