App Lifecycle
Understanding the app lifecycle of a webOS TV app will help you have a rough sketch on how the app will work, before you start designing your app. This session explains the app lifecycle based on the possible states of an app and transitions between them.
States of an app
The possible states of a webOS TV app are: Not Launched, Launched (Foreground), Suspended (Background). The state of an app can and will be changed by user interactions or system events.
-
Not Launched : The app has not been launched or it has been terminated. In this state, if the app receives a
webOSLaunch
event orvisibilityChange
event (visible), it will be launched. A launched or suspended app can be terminated and turns back to the Not Launched state by a user exiting it on the app UI, usingares-launch --close
command, or clicking Close App on the menu or Close on RCU on the Simulator. -
Launched : The app is running in the foreground. A launched app can be terminated or suspended at any time. In this state, if the user launches another app, the app will receive a
visibilityChange
event (hidden) and become suspended and hidden. -
Suspended : The app is suspended in the background. The app can be suspended for a short time to do specific background tasks. In this state, if the app receives a
webOSRelaunch
orvisibilityChange
event (visible), it will be turned back to the Launched state.
See also
- Check out the sample app about app lifecycle.
- For how to manage the app state in your app, see App Lifecycle Management.