1e41f4b71Sopenharmony_ci# @ohos.app.ability.AbilityConstant (AbilityConstant)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe **AbilityConstant** module defines the UIAbility-related enums, including the initial launch reasons, reasons for the last exit, ability continuation results, and window modes.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci> **NOTE**
6e41f4b71Sopenharmony_ci> 
7e41f4b71Sopenharmony_ci> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci> 
9e41f4b71Sopenharmony_ci> - The APIs of this module can be used only in the stage model.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci## Modules to Import
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci```ts
14e41f4b71Sopenharmony_ciimport { AbilityConstant } from '@kit.AbilityKit';
15e41f4b71Sopenharmony_ci```
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci## LaunchParam
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ciDefines the parameters for starting an ability. The parameter values are automatically passed in by the system when the ability is started. You do not need to change the values.
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci| Name| Type| Read-only| Optional| Description|
24e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
25e41f4b71Sopenharmony_ci| launchReason | [LaunchReason](#launchreason)| No| No| Ability launch reason, which is an enumerated type.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
26e41f4b71Sopenharmony_ci| lastExitReason | [LastExitReason](#lastexitreason) | No| No| Reason for the last exit, which is an enumerated type.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
27e41f4b71Sopenharmony_ci| lastExitMessage<sup>12+</sup> | string | No| No| Reason for the last exit.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci## LaunchReason
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ciEnumerates the initial ability launch reasons. You can use it together with the value of **launchParam.launchReason** in [onCreate(want, launchParam)](js-apis-app-ability-uiAbility.md#uiabilityoncreate) of the UIAbility to complete different operations.
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_ci| Name                         | Value  | Description                                                        |
36e41f4b71Sopenharmony_ci| ----------------------------- | ---- | ------------------------------------------------------------ |
37e41f4b71Sopenharmony_ci| UNKNOWN          | 0    | Unknown reason.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
38e41f4b71Sopenharmony_ci| START_ABILITY          | 1    | The ability is started by calling [startAbility](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
39e41f4b71Sopenharmony_ci| CALL | 2    | The ability is started by calling [startAbilityByCall](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartabilitybycall).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
40e41f4b71Sopenharmony_ci| CONTINUATION           | 3    | The ability is started by means of cross-device migration.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
41e41f4b71Sopenharmony_ci| APP_RECOVERY           | 4    | The ability is automatically started when the application is restored from a fault.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
42e41f4b71Sopenharmony_ci| SHARE<sup>10+</sup>           | 5    | The ability is started by means of atomic service sharing.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
43e41f4b71Sopenharmony_ci| AUTO_STARTUP<sup>11+</sup>           | 8    | The ability is automatically started upon system boot.|
44e41f4b71Sopenharmony_ci| INSIGHT_INTENT<sup>11+</sup>           | 9    | The ability is started by the InsightIntent framework.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci**Example**
47e41f4b71Sopenharmony_ci
48e41f4b71Sopenharmony_ci```ts
49e41f4b71Sopenharmony_ciimport { UIAbility, Want, AbilityConstant } from '@kit.AbilityKit';
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
52e41f4b71Sopenharmony_ci  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
53e41f4b71Sopenharmony_ci    if (launchParam.launchReason === AbilityConstant.LaunchReason.START_ABILITY) {
54e41f4b71Sopenharmony_ci      console.log('The ability has been started by the way of startAbility.');
55e41f4b71Sopenharmony_ci    }
56e41f4b71Sopenharmony_ci  }
57e41f4b71Sopenharmony_ci}
58e41f4b71Sopenharmony_ci```
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci## LastExitReason
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ciEnumerates the reasons for the last exit. You can use it together with the value of **launchParam.lastExitReason** in [onCreate(want, launchParam)](js-apis-app-ability-uiAbility.md#uiabilityoncreate) of the UIAbility to complete different operations.
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_ci| Name                         | Value  | Description                                                        |
67e41f4b71Sopenharmony_ci| ----------------------------- | ---- | ------------------------------------------------------------ |
68e41f4b71Sopenharmony_ci| UNKNOWN          | 0    | Unknown reason.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
69e41f4b71Sopenharmony_ci| ABILITY_NOT_RESPONDING<sup>(deprecated)</sup> | 1    | The ability does not respond.<br>**NOTE**<br>This enum is supported since API version 9 and deprecated since API version 10. You are advised to use **APP_FREEZE**.|
70e41f4b71Sopenharmony_ci| NORMAL | 2    | The ability exits normally because the user closes the application.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
71e41f4b71Sopenharmony_ci| CPP_CRASH<sup>10+</sup>  | 3    | The ability exits due to abnormal signals on the local host.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
72e41f4b71Sopenharmony_ci| JS_ERROR<sup>10+</sup>  | 4    | The ability exits due to a JS_ERROR fault triggered when an application has a JS syntax error that is not captured by developers.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
73e41f4b71Sopenharmony_ci| APP_FREEZE<sup>10+</sup>  | 5    | The ability exits because watchdog detects that the application is frozen.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
74e41f4b71Sopenharmony_ci| PERFORMANCE_CONTROL<sup>10+</sup>  | 6    | The ability exits due to system performance problems, for example, insufficient device memory.<br>**Atomic service API**: This API can be used in atomic services since API version 11.<br>**NOTE**: This API will be deprecated. You are advised to use **RESOURCE_CONTROL** instead.|
75e41f4b71Sopenharmony_ci| RESOURCE_CONTROL<sup>10+</sup>  | 7    | The ability exits due to improper use of system resources. The specific error cause can be obtained through [LaunchParam.lastExitMessage](#launchparam). The possible causes are as follows:<br> - **CPU Highload**: The CPU load is high.<br> - **CPU_EXT Highload**: A fast CPU load detection is carried out.<br> - **IO Manage Control**: An I/O management and control operation is carried out.<br> -** App Memory Deterioration**: The application memory usage exceeds the threshold.<br> - **Temperature Control**: The temperature is too high or too low.<br> - **Memory Pressure**: The system is low on memory, triggering ability exiting in ascending order of priority.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
76e41f4b71Sopenharmony_ci| UPGRADE<sup>10+</sup>  | 8    | The ability exits due to an update.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci**Example**
79e41f4b71Sopenharmony_ci
80e41f4b71Sopenharmony_ci```ts
81e41f4b71Sopenharmony_ciimport { UIAbility, Want, AbilityConstant } from '@kit.AbilityKit';
82e41f4b71Sopenharmony_ci
83e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
84e41f4b71Sopenharmony_ci  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
85e41f4b71Sopenharmony_ci    if (launchParam.lastExitReason === AbilityConstant.LastExitReason.APP_FREEZE) {
86e41f4b71Sopenharmony_ci      console.log('The ability has exit last because the ability was not responding.');
87e41f4b71Sopenharmony_ci    }
88e41f4b71Sopenharmony_ci    if (launchParam.lastExitReason === AbilityConstant.LastExitReason.RESOURCE_CONTROL) {
89e41f4b71Sopenharmony_ci      console.log('The ability has exit last because the rss control, the lastExitReason is '+ launchParam.lastExitReason + ', the lastExitMessage is ' + launchParam.lastExitMessage);
90e41f4b71Sopenharmony_ci    }
91e41f4b71Sopenharmony_ci  }
92e41f4b71Sopenharmony_ci}
93e41f4b71Sopenharmony_ci```
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci## OnContinueResult 
96e41f4b71Sopenharmony_ci
97e41f4b71Sopenharmony_ciEnumerates the ability continuation results. You can use it together with [onContinue(wantParam)](js-apis-app-ability-uiAbility.md#uiabilityoncontinue) of the UIAbility to complete different operations.
98e41f4b71Sopenharmony_ci
99e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
100e41f4b71Sopenharmony_ci
101e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ci| Name                         | Value  | Description                                                        |
104e41f4b71Sopenharmony_ci| ----------------------------- | ---- | ------------------------------------------------------------ |
105e41f4b71Sopenharmony_ci| AGREE           | 0    | The ability continuation is accepted.|
106e41f4b71Sopenharmony_ci| REJECT           | 1    | The ability continuation is rejected. If the application is abnormal in [onContinue](js-apis-app-ability-uiAbility.md#uiabilityoncontinue), which results in abnormal display during data restoration, this error code is returned.|
107e41f4b71Sopenharmony_ci| MISMATCH  | 2    | The version does not match. The application on the initiator can obtain the version of the target application from [onContinue](js-apis-app-ability-uiAbility.md#uiabilityoncontinue). If the ability continuation cannot be performed due to version mismatch, this error code is returned.|
108e41f4b71Sopenharmony_ci
109e41f4b71Sopenharmony_ci**Example**
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ci```ts
112e41f4b71Sopenharmony_ciimport { UIAbility, AbilityConstant } from '@kit.AbilityKit';
113e41f4b71Sopenharmony_ci
114e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
115e41f4b71Sopenharmony_ci  onContinue(wantParam: Record<string, Object>) {
116e41f4b71Sopenharmony_ci    return AbilityConstant.OnContinueResult.AGREE;
117e41f4b71Sopenharmony_ci  }
118e41f4b71Sopenharmony_ci}
119e41f4b71Sopenharmony_ci```
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci## MemoryLevel
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ciEnumerates the memory levels. You can use it in [onMemoryLevel(level)](js-apis-app-ability-ability.md#abilityonmemorylevel) of the UIAbility to complete different operations.
124e41f4b71Sopenharmony_ci
125e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ci| Name                        | Value| Description               |
130e41f4b71Sopenharmony_ci| ---                         | --- | ---           |
131e41f4b71Sopenharmony_ci| MEMORY_LEVEL_MODERATE       | 0   | Moderate memory usage.|
132e41f4b71Sopenharmony_ci| MEMORY_LEVEL_LOW            | 1   | Low memory usage.  |
133e41f4b71Sopenharmony_ci| MEMORY_LEVEL_CRITICAL       | 2   | High memory usage.  |
134e41f4b71Sopenharmony_ci
135e41f4b71Sopenharmony_ci**Example**
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci```ts
138e41f4b71Sopenharmony_ciimport { UIAbility, AbilityConstant } from '@kit.AbilityKit';
139e41f4b71Sopenharmony_ci
140e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
141e41f4b71Sopenharmony_ci  onMemoryLevel(level: AbilityConstant.MemoryLevel) {
142e41f4b71Sopenharmony_ci    if (level === AbilityConstant.MemoryLevel.MEMORY_LEVEL_CRITICAL) {
143e41f4b71Sopenharmony_ci      console.log('The memory of device is critical, please release some memory.');
144e41f4b71Sopenharmony_ci    }
145e41f4b71Sopenharmony_ci  }
146e41f4b71Sopenharmony_ci}
147e41f4b71Sopenharmony_ci```
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ci## WindowMode<sup>12+</sup>
150e41f4b71Sopenharmony_ci
151e41f4b71Sopenharmony_ciEnumerates the window mode when the ability is started. It can be used together with [startAbility](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability) to specify the window mode for starting the ability.
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
154e41f4b71Sopenharmony_ci
155e41f4b71Sopenharmony_ci| Name                       | Value| Description                |
156e41f4b71Sopenharmony_ci| ---                         | --- | ---                  |
157e41f4b71Sopenharmony_ci| WINDOW_MODE_FULLSCREEN      | 1   | Full screen mode. It takes effect only on 2-in-1 devices and tablets.        |
158e41f4b71Sopenharmony_ci| WINDOW_MODE_SPLIT_PRIMARY   | 100 | Primary screen (left screen in the case of horizontal orientation) in split-screen mode. It is valid only in intra-app redirection scenarios.  |
159e41f4b71Sopenharmony_ci| WINDOW_MODE_SPLIT_SECONDARY | 101 | Secondary screen (right screen in the case of horizontal orientation) in split-screen mode. It is valid only in intra-app redirection scenarios.  |
160e41f4b71Sopenharmony_ci
161e41f4b71Sopenharmony_ci**Example**
162e41f4b71Sopenharmony_ci
163e41f4b71Sopenharmony_ci```ts
164e41f4b71Sopenharmony_ciimport { UIAbility, StartOptions, Want, AbilityConstant } from '@kit.AbilityKit';
165e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit';
166e41f4b71Sopenharmony_ci
167e41f4b71Sopenharmony_cilet want: Want = {
168e41f4b71Sopenharmony_ci  bundleName: 'com.example.myapplication',
169e41f4b71Sopenharmony_ci  abilityName: 'EntryAbility'
170e41f4b71Sopenharmony_ci};
171e41f4b71Sopenharmony_cilet option: StartOptions = {
172e41f4b71Sopenharmony_ci  windowMode: AbilityConstant.WindowMode.WINDOW_MODE_SPLIT_PRIMARY
173e41f4b71Sopenharmony_ci};
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ci// Ensure that the context is obtained.
176e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
177e41f4b71Sopenharmony_ci  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
178e41f4b71Sopenharmony_ci    this.context.startAbility(want, option).then(() => {
179e41f4b71Sopenharmony_ci      console.log('Succeed to start ability.');
180e41f4b71Sopenharmony_ci    }).catch((error: BusinessError) => {
181e41f4b71Sopenharmony_ci      console.error(`Failed to start ability with error: ${JSON.stringify(error)}`);
182e41f4b71Sopenharmony_ci    });
183e41f4b71Sopenharmony_ci  }
184e41f4b71Sopenharmony_ci}
185e41f4b71Sopenharmony_ci```
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ci## OnSaveResult
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ciEnumerates the result types for the operation of saving application data. You can use it in [onSaveState(reason, wantParam)](js-apis-app-ability-uiAbility.md#uiabilityonsavestate) of the UIAbility to complete different operations.
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ci| Name                         | Value  | Description                                                        |
196e41f4b71Sopenharmony_ci| ----------------------------- | ---- | ------------------------------------------------------------ |
197e41f4b71Sopenharmony_ci| ALL_AGREE           | 0    | Always agreed to save the status.|
198e41f4b71Sopenharmony_ci| CONTINUATION_REJECT           | 1    | Rejected to save the status in continuation.|
199e41f4b71Sopenharmony_ci| CONTINUATION_MISMATCH  | 2    | Continuation mismatch.|
200e41f4b71Sopenharmony_ci| RECOVERY_AGREE           | 3    | Agreed to restore the saved status.|
201e41f4b71Sopenharmony_ci| RECOVERY_REJECT  | 4    | Rejected to restore the saved status.|
202e41f4b71Sopenharmony_ci| ALL_REJECT  | 5    | Always rejected to save the status.|
203e41f4b71Sopenharmony_ci
204e41f4b71Sopenharmony_ci**Example**
205e41f4b71Sopenharmony_ci
206e41f4b71Sopenharmony_ci```ts
207e41f4b71Sopenharmony_ciimport { UIAbility, AbilityConstant } from '@kit.AbilityKit';
208e41f4b71Sopenharmony_ci
209e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
210e41f4b71Sopenharmony_ci  onSaveState(reason: AbilityConstant.StateType, wantParam: Record<string, Object>) {
211e41f4b71Sopenharmony_ci    return AbilityConstant.OnSaveResult.ALL_AGREE;
212e41f4b71Sopenharmony_ci  }
213e41f4b71Sopenharmony_ci}
214e41f4b71Sopenharmony_ci```
215e41f4b71Sopenharmony_ci
216e41f4b71Sopenharmony_ci## StateType
217e41f4b71Sopenharmony_ci
218e41f4b71Sopenharmony_ciEnumerates the scenarios for saving application data. You can use it in [onSaveState(reason, wantParam)](js-apis-app-ability-uiAbility.md#uiabilityonsavestate) of the UIAbility to complete different operations.
219e41f4b71Sopenharmony_ci
220e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
221e41f4b71Sopenharmony_ci
222e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
223e41f4b71Sopenharmony_ci
224e41f4b71Sopenharmony_ci| Name                         | Value  | Description                                                        |
225e41f4b71Sopenharmony_ci| ----------------------------- | ---- | ------------------------------------------------------------ |
226e41f4b71Sopenharmony_ci| CONTINUATION           | 0    | Saving the status in continuation.|
227e41f4b71Sopenharmony_ci| APP_RECOVERY           | 1    | Saving the status in application recovery.|
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ci**Example**
230e41f4b71Sopenharmony_ci
231e41f4b71Sopenharmony_ci```ts
232e41f4b71Sopenharmony_ciimport { UIAbility, AbilityConstant } from '@kit.AbilityKit';
233e41f4b71Sopenharmony_ci
234e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
235e41f4b71Sopenharmony_ci  onSaveState(reason: AbilityConstant.StateType, wantParam: Record<string, Object>) {
236e41f4b71Sopenharmony_ci    if (reason === AbilityConstant.StateType.CONTINUATION) {
237e41f4b71Sopenharmony_ci      console.log('Save the ability data when the ability continuation.');
238e41f4b71Sopenharmony_ci    }
239e41f4b71Sopenharmony_ci    return AbilityConstant.OnSaveResult.ALL_AGREE;
240e41f4b71Sopenharmony_ci  }
241e41f4b71Sopenharmony_ci}
242e41f4b71Sopenharmony_ci```
243e41f4b71Sopenharmony_ci
244e41f4b71Sopenharmony_ci## ContinueState<sup>10+</sup>
245e41f4b71Sopenharmony_ci
246e41f4b71Sopenharmony_ciEnumerates the mission continuation states of the application. It is used in the [setMissionContinueState](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissioncontinuestate10) API of [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md).
247e41f4b71Sopenharmony_ci
248e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
249e41f4b71Sopenharmony_ci
250e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
251e41f4b71Sopenharmony_ci
252e41f4b71Sopenharmony_ci| Name          | Value      | Description                                                        |
253e41f4b71Sopenharmony_ci| ------------- | --------- | ------------------------------------------------------------ |
254e41f4b71Sopenharmony_ci| ACTIVE        | 0         | Mission continuation is activated for the current application.                             |
255e41f4b71Sopenharmony_ci| INACTIVE      | 1         | Mission continuation is not activated for the current application.                           |
256e41f4b71Sopenharmony_ci
257e41f4b71Sopenharmony_ci**Example**
258e41f4b71Sopenharmony_ci
259e41f4b71Sopenharmony_ci```ts
260e41f4b71Sopenharmony_ciimport { UIAbility, Want, AbilityConstant } from '@kit.AbilityKit';
261e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit';
262e41f4b71Sopenharmony_ci
263e41f4b71Sopenharmony_ciclass MyAbility extends UIAbility {
264e41f4b71Sopenharmony_ci  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
265e41f4b71Sopenharmony_ci    this.context.setMissionContinueState(AbilityConstant.ContinueState.INACTIVE, (result: BusinessError) => {
266e41f4b71Sopenharmony_ci      console.info(`setMissionContinueState: ${JSON.stringify(result)}`);
267e41f4b71Sopenharmony_ci    });
268e41f4b71Sopenharmony_ci  }
269e41f4b71Sopenharmony_ci}
270e41f4b71Sopenharmony_ci```
271