harmony 鸿蒙AbilityStateData
AbilityStateData
The AbilityStateData module defines the ability state information, which can be obtained through the onAbilityStateChanged lifecycle callback of ApplicationStateObserver. The callback can be invoked after a lifecycle change listener is registered through on.
NOTE
The initial APIs of this module are supported since API version 14. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Modules to Import
import { appManager } from '@kit.AbilityKit';
Properties
System capability: SystemCapability.Ability.AbilityRuntime.Core
Name | Type | Readable | Writable | Description |
---|---|---|---|---|
pid | number | Yes | No | Process ID. |
bundleName | string | Yes | No | Bundle name. |
abilityName | string | Yes | No | Ability name. |
uid | number | Yes | No | User ID. |
state | number | Yes | No | Ability state. - In the stage model, the states of a UIAbility are described in Ability States, and the states of an ExtensionAbility are described in ExtensionAbility States. - In the FA model, the states of an ability are described in Ability States. |
moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. |
abilityType | number | Yes | No | Ability type, which can be page or service. |
isAtomicService | boolean | Yes | No | Whether the ability belongs to an atomic service. true: The ability belongs to an atomic service. false: The ability does not belong to an atomic service. |
appCloneIndex | number | Yes | No | Index of an application clone. |
Ability States
Value | State | Description |
---|---|---|
0 | ABILITY_STATE_CREATE | The ability is being created. |
1 | ABILITY_STATE_READY | The ability has been created. |
2 | ABILITY_STATE_FOREGROUND | The ability is running in the foreground. |
3 | ABILITY_STATE_FOCUS | The ability has focus. |
4 | ABILITY_STATE_BACKGROUND | The ability is running in the background. |
5 | ABILITY_STATE_TERMINATED | The ability is terminated. |
7 | ABILITY_STATE_CONNECTED | The background service is connected to the client. |
8 | ABILITY_STATE_DISCONNECTED | The background service is disconnected from the client. |
ExtensionAbility States
Value | State | Description |
---|---|---|
0 | EXTENSION_STATE_CREATE | The ExtensionAbility is being created. |
1 | EXTENSION_STATE_READY | The ExtensionAbility has been created. |
2 | EXTENSION_STATE_CONNECTED | The ExtensionAbility is connected to the client. |
3 | EXTENSION_STATE_DISCONNECTED | The ExtensionAbility is disconnected from the client. |
4 | EXTENSION_STATE_TERMINATED | The ExtensionAbility is terminated. |
Ability Types
Value | Type | Description |
---|---|---|
0 | UNKNOWN | Unknown type. |
1 | PAGE | Ability that has the UI. |
2 | SERVICE | Ability that provides the background service. |
3 | DATA | Ability that provides the data service. |
4 | FORM | Ability that provides the widget service. |
5 | EXTENSION | Ability that provides extension capabilities. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙AbilityAccessControl
harmony 鸿蒙OH_NativeBundle_ApplicationInfo
harmony 鸿蒙OH_NativeBundle_ElementName
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦