tezvyn:

Handle Android Process Death vs. Configuration Changes

Source: developer.android.comadvanced

Tests your grasp of Android's lifecycle for state restoration. A good answer explains that `onCreate(savedInstanceState)` is called in both cases, but process death recreates everything. Use `ViewModel` with `SavedStateHandle`.

This tests deep knowledge of the Android lifecycle, distinguishing a configuration change (process lives) from process death (process is killed and recreated). A great answer explains that `onCreate(savedInstanceState)` is the entry point for restoration in both scenarios, but only `SavedStateHandle` paired with a `ViewModel` correctly survives process death by persisting UI state. A common red flag is assuming a standard `ViewModel` survives process death or confusing `onSaveInstanceState` with permanent storage.

Read the original → developer.android.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Handle Android Process Death vs. Configuration Changes · Tezvyn