js-apis-application-abilityConstant.md 1.9 KB
Newer Older
W
wusongqing 已提交
1 2
# AbilityConstant

3
> **NOTE**<br>
W
wusongqing 已提交
4
> 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.
W
wusongqing 已提交
5 6 7 8 9 10 11


Provides parameters related to ability launch.


## Modules to Import

W
wusongqing 已提交
12

W
wusongqing 已提交
13 14 15 16 17 18 19
```js
import AbilityConstant from '@ohos.application.AbilityConstant';
```


## Attributes

W
wusongqing 已提交
20 21
**System capability**: SystemCapability.Ability.AbilityRuntime.Core

22 23 24 25
 | Name | Type | Readable | Writable | Description | 
 | -------- | -------- | -------- | -------- | -------- |
 | launchReason | LaunchReason | Yes | Yes | Ability launch reason. | 
 | lastExitReason | LastExitReason | Yes | Yes | Reason for the last exit. | 
W
wusongqing 已提交
26 27 28 29 30

## AbilityConstant.LaunchReason

Enumerates ability launch reasons.

W
wusongqing 已提交
31 32
**System capability**: SystemCapability.Ability.AbilityRuntime.Core

33 34 35 36 37 38
 | Name | Value | Description |
 | ----------------------------- | ---- | ------------------------------------------------------------ |
 | UNKNOWN | 0 | Unknown reason. |
 | START_ABILITY | 1 | Ability startup. |
 | CALL | 2 | Call. |
 | CONTINUATION | 3 | Ability continuation. |
W
wusongqing 已提交
39 40


W
wusongqing 已提交
41
## AbilityConstant.LastExitReason
W
wusongqing 已提交
42 43 44

Enumerates reasons for the last exit.

W
wusongqing 已提交
45 46
**System capability**: SystemCapability.Ability.AbilityRuntime.Core

47 48 49 50 51
 | Name | Value | Description |
 | ----------------------------- | ---- | ------------------------------------------------------------ |
 | UNKNOWN | 0 | Unknown reason. |
 | ABILITY_NOT_RESPONDING | 1 | The ability does not respond. |
 | NORMAL | 2 | Normal status. |
W
wusongqing 已提交
52 53 54 55 56 57


## AbilityConstant.OnContinueResult 

Enumerates ability continuation results.

W
wusongqing 已提交
58 59
**System capability**: SystemCapability.Ability.AbilityRuntime.Core

60 61 62 63 64
 | Name | Value | Description |
 | ----------------------------- | ---- | ------------------------------------------------------------ |
 | AGREE | 0 | Continuation agreed. |
 | REJECT | 1 | Continuation denied. |
 | MISMATCH | 2 | Mismatch. |