Single Activity by Example
summary
Claim: converting every screen into fragments and running a true single‑activity app works in production and simplifies lifecycle, analytics and startup checks. Concrete tools and patterns: AndroidX navigation library, Dagger Android, Play Store subscription API, setReorderingAllowed to avoid redundant view churn, primaryNavigationFragment for depth‑first back handling, and a replaceStack strategy to rebuild back stacks. A real NHL‑based app reaches four–five nested fragment layers, removes splash activities, and runs reliably in production.
AI-written summary · about
chapters (17)
- 0:00Start
- 3:15Match Detail
- 3:38Fragment Navigation
- 4:03What Is a Back Stack
- 5:52Build a Back Stack
- 9:26State Changes
- 11:03Primary Navigation Fragment
- 11:32Primary Navigation Fragments
- 16:47Replaced Back Stack
- 17:54Scalability
- 20:43Onboarding Flow
- 25:53Bottom Navigation
- 29:01Startup Checks
- 32:30Key Takeaways and Tips
- 34:10Caveats Related to Fragments
- 36:06Transitions Support in Fragments
- 36:37Sample Project
related talks
39mSingle activity: Why, when, and how
46mModern Android: How to ditch Activities and Fragments
06m10 best practices for moving to a single activity
26mSingle activity navigation so simple even I can understand it
42mRoad to Single Activity
38mMigrating to a Single-Activity Architecture in a Modular App
53mSimplified Single-Activity Apps Using Simple-Stack
36mNavigation and the Single Activity: Learnings from a Skeptic
