In 2017, Zappos engineer David Henry told Google his team already had a ViewModel before Android offered one. They had wired together other tools to keep it alive when a screen was rebuilt. Think about what a customer might do to set all that machinery in motion: turn a phone sideways halfway through looking for a pair of shoes. Why should a change in the shape of the screen be able to undo a search?

Before 2017

The phone turned. The search started over.

Imagine typing “trail shoes,” narrowing the list to your size, and turning the phone for a better look at the photos. Android can destroy and recreate the Activity, the object hosting that screen, so the app can use the layout and other resources meant for the new orientation. If the old Activity was also the only place keeping track of the search, the new one could come up empty or start the same request again.

Rebuilding the screen gave Android a consistent way to handle changes in the device. But teams had to decide what would outlive the screen, and each team could end up building its own handoff. Zappos used Loaders and dependency injection to preserve its own ViewModel across configuration changes. That work was invisible if the app got it right.

2017–2018

Google gives the search somewhere else to live

Google acknowledged the trouble in May 2017, when it previewed Android Architecture Components at Google I/O. Its ViewModel moved ownership of the search out of the Activity. The rebuilt screen could reconnect to the same ViewModel, pick up the query and results, and show work that was already underway. The screen could change shape without turning the search into a new one.

The Lifecycle library reached its first stable release that November and later became part of Android Jetpack. Henry said switching to Google’s ViewModel removed the plumbing Zappos had written for the job. His team could spend more time on design, app logic, and testing. Google had turned a workaround one team had to maintain into a library other teams could choose to use.

The portrait and landscape screens are separate Activity instances. They can reconnect to the same ViewModel, where the search query and results stay during rotation.

The limit of the handoff

What if the whole app is gone?

Now imagine leaving the shoe search to take a call. While the app sits in the background, Android can reclaim its process. A ViewModel lives in memory, so this time it goes away too. When Android restores the task, SavedStateHandle can bring back a small clue such as the search text or a selected item ID. The app can rebuild the results around that clue.

A list of shoes someone deliberately saved is a different kind of promise. It belongs in durable storage so it is there on a later visit, even if there is no task to restore. The same screen can show all three things at once: results that survive rotation in memory, a query it can recover after a process restart, and favorites it should keep until the customer removes them.

2026

Then the screen started folding

The ability to change the screen without losing your place became useful for more than rotation. In 2026, Google reported that Flo Health used ViewModel and Jetpack Compose state tools to keep key flows intact as users rotated, unfolded, or resized their screens. Flo engineer Aleksandr Kolodiazhnyi said the team cut its state preservation code by roughly 30 percent. That was Flo’s result from combining several tools; it was not a measurement of ViewModel on its own.

The next device may arrange the screen differently again. The shopper still expects to see those same shoes. That is what the old rotation bug taught Android teams: the way you display a task can change in the middle of it, but the user should be able to carry on.

Original sources