AppLifecycle

Process-wide singleton holding observable foreground / background state.

Singleton (rather than DI-injected) because every consumer in the app needs to observe the same value, and there is exactly one OS-level lifecycle per process.

Properties

Link copied to clipboard
val isForeground: StateFlow<Boolean>

true while the host app is foregrounded / visible. Observers should pause discretionary work whenever this flips to false.

Functions

Link copied to clipboard

Called by the platform integration when the app is sent to background.

Link copied to clipboard

Called by the platform integration when the app becomes foregrounded.