harmony 鸿蒙AbilityStateData

2022-12-22 浏览 (609)

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 registerApplicationStateObserver.

NOTE

The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import appManager from '@ohos.application.appManager';

Attributes

System capability: SystemCapability.Ability.AbilityRuntime.Core

System API: This is a system API and cannot be called by third-party applications.

NameTypeReadableWritableDescription
pidnumberYesNoProcess ID.
bundleNamestringYesNoBundle name.
abilityNamestringYesNoAbility name.
uidnumberYesNoUser ID.
statenumberYesNoAbility state.
moduleName9+stringYesNoName of the HAP file to which the ability belongs.
abilityTypenumberYesNoAbility type, which can be page or service.

Ability States

ValueStateDescription
0ABILITY_STATE_CREATEThe ability is being created.
1ABILITY_STATE_READYThe ability has been created.
2ABILITY_STATE_FOREGROUNDThe ability is running in the foreground.
3ABILITY_STATE_FOCUSThe ability has focus.
4ABILITY_STATE_BACKGROUNDThe ability is running in the background.
5ABILITY_STATE_TERMINATEDThe ability is terminated.
8ABILITY_STATE_CONNECTEDThe background service is connected to the client.
9ABILITY_STATE_DISCONNECTEDThe background service is disconnected from the client.

Ability Types

ValueStateDescription
0UNKNOWNUnknown type.
1PAGEAbility that has the UI.
2SERVICEAbility that provides the background service.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/e4b268c39613444aa7e443bfa79ccd70