Road to Single Activity
summary
Migrates a large Android app from Fragments/AndroidView to Jetpack Compose and consolidates many Activities into one working main activity, using Navigation Compose 2.7.7 with nested and common NavGraphs. Implements multi-backstack via saveState/restoreState and a BackHandler-driven history queue to reproduce tab selection history, replaces activity‑for‑result with backstack SavedStateHandle passing, and routes complex deep links through a custom DeepLinkNavigator. Result: single‑activity architecture achieved and sample repo published.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 4:17App background and features
- 7:32Purpose of migrating from fragments to Compose
- 10:44Migration overview and phases
- 11:04Phase 1: Compose UI
- 17:12Integrating common screens into graph
- 19:37NavHost implementation and graph connection
- 20:21Phase 2: Graph integration
- 21:47Tab behavior and back stack management
- 27:13Handling back events
- 30:30Basic Single Activity setup
- 31:55Replacing Activity Result
- 32:40Tab display state control
- 35:46Restoring tab state on back
- 36:51Deep link navigation integration
- 40:22Single Activity completion
- 40:44Migration results and future outlook
- 41:30Sample implementation and Q&A
related talks
38mMigrating to a Single-Activity Architecture in a Modular App
36mNavigation and the Single Activity: Learnings from a Skeptic
53mSimplified Single-Activity Apps Using Simple-Stack
39mSingle activity: Why, when, and how
42mHow We Built Our SingleState Navigation Framework on Android
42mComposing your navigation: charting your route in the Jetpack ecosystem
46mModern Android: How to ditch Activities and Fragments
44mMigrating Android apps from Fragments to Jetpack Compose
