From 5285ff6b968e3acfdb13a220f3b271d956d57020 Mon Sep 17 00:00:00 2001 From: liyan Date: Thu, 2 Feb 2023 02:58:36 +0000 Subject: [PATCH] update en/application-dev/application-models/uiability-lifecycle.md. Signed-off-by: li-yan339 Signed-off-by: liyan --- .../application-models/uiability-lifecycle.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/en/application-dev/application-models/uiability-lifecycle.md b/en/application-dev/application-models/uiability-lifecycle.md index 9ec701cbff..57200abb8f 100644 --- a/en/application-dev/application-models/uiability-lifecycle.md +++ b/en/application-dev/application-models/uiability-lifecycle.md @@ -7,8 +7,9 @@ When a user opens, switches, and returns to an application, the UIAbility instan The lifecycle of UIAbility has four states: **Create**, **Foreground**, **Background**, and **Destroy**, as shown in the figure below. -**Figure 1** UIAbility lifecycle states -Ability-Life-Cycle +**Figure 1** UIAbility lifecycle states + +![Ability-Life-Cycle](figures/Ability-Life-Cycle.png) ## Description of Lifecycle States @@ -36,8 +37,9 @@ export default class EntryAbility extends UIAbility { After the UIAbility instance is created but before it enters the **Foreground** state, the system creates a WindowStage instance and triggers the **onWindowStageCreate()** callback. You can set UI loading and WindowStage event subscription in the callback. -**Figure 2** WindowStageCreate and WindowStageDestory -Ability-Life-Cycle-WindowStage +**Figure 2** WindowStageCreate and WindowStageDestory + +![Ability-Life-Cycle-WindowStage](figures/Ability-Life-Cycle-WindowStage.png) In the **onWindowStageCreate()** callback, use [loadContent()](../reference/apis/js-apis-window.md#loadcontent9-2) to set the page to be loaded, and call [on('windowStageEvent')](../reference/apis/js-apis-window.md#onwindowstageevent9) to subscribe to [WindowStage events](../reference/apis/js-apis-window.md#windowstageeventtype9), for example, having or losing focus, or becoming visible or invisible. -- GitLab