• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# AbilityConstant
2
3> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
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.
5
6
7Provides parameters related to ability launch.
8
9
10## Modules to Import
11
12
13```js
14import AbilityConstant from '@ohos.application.AbilityConstant';
15```
16
17
18## Attributes
19
20**System capability**: SystemCapability.Ability.AbilityRuntime.Core
21
22| Name| Type| Readable| Writable| Description|
23| -------- | -------- | -------- | -------- | -------- |
24| launchReason | LaunchReason| Yes| Yes| Ability launch reason.|
25| lastExitReason | LastExitReason | Yes| Yes| Reason for the last exit.|
26
27## AbilityConstant.LaunchReason
28
29Enumerates ability launch reasons.
30
31**System capability**: SystemCapability.Ability.AbilityRuntime.Core
32
33| Name                         | Value  | Description                                                        |
34| ----------------------------- | ---- | ------------------------------------------------------------ |
35| UNKNOWN          | 0    | Unknown reason.|
36| START_ABILITY          | 1    | Ability startup.|
37| CALL | 2    | Call.|
38| CONTINUATION           | 3    | Ability continuation.|
39
40
41## AbilityConstant.LastExitReason
42
43Enumerates reasons for the last exit.
44
45**System capability**: SystemCapability.Ability.AbilityRuntime.Core
46
47| Name                         | Value  | Description                                                        |
48| ----------------------------- | ---- | ------------------------------------------------------------ |
49| UNKNOWN          | 0    | Unknown reason.|
50| ABILITY_NOT_RESPONDING          | 1    | The ability does not respond.|
51| NORMAL | 2    | Normal status.|
52
53
54## AbilityConstant.OnContinueResult
55
56Enumerates ability continuation results.
57
58**System capability**: SystemCapability.Ability.AbilityRuntime.Core
59
60| Name                         | Value  | Description                                                        |
61| ----------------------------- | ---- | ------------------------------------------------------------ |
62| AGREE           | 0    | Continuation agreed.|
63| REJECT           | 1    | Continuation denied.|
64| MISMATCH  | 2    | Mismatch.|
65