There are 5 App sates in total, which can be categorized further like App’s Foreground and Background states.
- Not running / Terminated state
- Inactive state
- Active state
- Background state
- Suspended state
![]() |
| Cycle between the app states. (Image credit: InterviewBit) |
NOT RUNNING / TERMINATED STATE
App (Process) does not exist in memory, it is not visible, not running, there is no CPU/GPU or other resource consumption, not a trace of activity.INACTIVE STATE
The App (Process) does not receive events, this state can be triggered by system interruption, like when Incoming call arrives, or by other user actions like when user locks the device. It's worth noting that this state happens only in the foreground. This state occurs for a brief moment, as well, when the App is being launched to active foreground state or from the background state.ACTIVE STATE
This is the main Application state when the App (Process) is running in the Foreground, UI is visible and the App is receiving events.BACKGROUND STATE
An app in the background is not considered active unless it is performing background tasks (e.g., VoIP, location updates, or background fetch). This state can also occur for a brief period when the App is about to transition to the suspended state, to give time for some small dispatched tasks to finish. App can transition to this state while launching from the not running state (usually when voip push arrives), as well. Also, when transitioning to the suspended state, the system allows a short period for tasks to complete before freezing the app.SUSPENDED STATE
In the suspended state, the Process (App) does not execute code. Process exist in memory, but the system can dispose of the current process at any time it decides (running low on battery power/memory) or other device resource limitations. Suspended apps do not execute code. They remain in memory until the system needs resources, at which point they may be terminated.To recap all the states again...
From not running state, the App can transition to active state in the foreground, by briefly getting by the inactive state.
The same cycle can happen, when the App will transition from the Background state. This cycle can happen when, for example, VoIP push arrives and wakes the device up in Background, before initiating UI. This cycle can also happen, for other various reasons, like launching the App from some Siri Intent extension, or by Location request.
From Active or Background state, the App can transition to the suspended state, where all the activity is suspended. From suspended state, the App transitions to the terminated or not running state and the cycle goes around 🙂

Comments
Post a Comment