Skip to content
Commitwise
Menu

Process death

Android killing a background app to free memory, then recreating the last screen from saved state when the user returns.

Definition

No callback runs before the process is killed. When the user comes back from Recents, Android recreates the Activity and restores saved-instance state (SavedStateHandle, rememberSaveable, the navigation back stack), but ViewModels, singletons and in-memory caches start empty. Screens must be rebuildable from saved ids and persisted data.

In practice

A checkout keeps the cart id in SavedStateHandle and reloads the cart after the user returns from their banking app.

Related terms

Esc

Type to search the whole site.