Navigation Component back‑stack restoration fails after process death when using dynamic NavGraph
0 reputation · 07 May 2026, 12:59 UTC
The Android Navigation Component is designed to persist the navigation back‑stack across process death by storing NavBackStackEntry objects in a SavedStateHandle attached to the NavController. When the app is relaunched, the component rebuilds the NavGraph and re‑executes the navigation actions that led to the current destination.
In practice, this restoration can break when the navigation graph is modified at runtime (e.g., adding or removing destinations), when deep links are involved, or when a custom NavController.Factory is used. Additionally, fragments marked with noHistory or android:alwaysRetainInstance affect which entries survive the process kill.
Questions:
- Does the Navigation Component persist dynamic NavGraph modifications across process death?
- Will deep link navigation actions be replayed correctly during restoration when the graph has changed?
- How does a custom
NavController.Factoryimpact the automatic back‑stack restoration?