Single-Activity Pattern

Activities and the Single-Activity Pattern

An activity is a component the system can launch: it owns a window, receives lifecycle callbacks and has a manifest entry. Older apps used one activity per screen, linked by intents, then one activity hosting Fragments. Google now recommends a single activity whose screens are composables swapped by Navigation Compose 234 (Navigation Compose), so moving between screens only changes state and screens can share a ViewModel. The system files activities into a task, the back stack Recents shows as one card. Add a second activity only when other apps must reach a screen directly, such as a share target (Intents and Resources).