harmony 鸿蒙@ohos.application.AbilityConstant (AbilityConstant)

2022-08-09 浏览 (981)

@ohos.application.AbilityConstant (AbilityConstant)

The AbilityConstant module defines the ability-related enums, including the initial launch reasons, reasons for the last exit, ability continuation results, and window modes.

NOTE

The APIs of this module are supported since API version 9 and are deprecated in versions later than API version 9. You are advised to use @ohos.app.ability.AbilityConstant instead. Newly added APIs will be marked with a superscript to indicate their earliest API version. The APIs of this module can be used only in the stage model.

Modules to Import

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

Attributes

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameTypeReadableWritableDescription
launchReasonLaunchReasonYesYesAbility launch reason.
lastExitReasonLastExitReasonYesYesReason for the last exit.

AbilityConstant.LaunchReason

Enumerates the initial ability launch reasons.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
UNKNOWN0Unknown reason.
START_ABILITY1Ability startup.
CALL2Call.
CONTINUATION3Ability continuation.
APP_RECOVERY4Application recovery.

AbilityConstant.LastExitReason

Enumerates the reasons for the last exit.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
UNKNOWN0Unknown reason.
ABILITY_NOT_RESPONDING1The ability does not respond.
NORMAL2Normal status.

AbilityConstant.OnContinueResult

Enumerates the ability continuation results.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
AGREE0Continuation agreed.
REJECT1Continuation denied.
MISMATCH2Mismatch.

AbilityConstant.WindowMode

Enumerates the window modes in which an ability can be displayed at startup.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
WINDOW_MODE_UNDEFINED0Undefined window mode.
WINDOW_MODE_FULLSCREEN1The ability is displayed in full screen.
WINDOW_MODE_SPLIT_PRIMARY100The ability is displayed in the primary window in split-screen mode.
WINDOW_MODE_SPLIT_SECONDARY101The ability is displayed in the secondary window in split-screen mode.
WINDOW_MODE_FLOATING102The ability is displayed in a floating window.

AbilityConstant.MemoryLevel

Enumerates the memory levels.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
MEMORY_LEVEL_MODERATE0Moderate memory usage.
MEMORY_LEVEL_LOW1Low memory usage.
MEMORY_LEVEL_CRITICAL2High memory usage.

AbilityConstant.OnSaveResult

Enumerates the result types for the operation of saving application data.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
ALL_AGREE0Agreed to save the status.
CONTINUATION_REJECT1Rejected to save the status in continuation.
CONTINUATION_MISMATCH2Continuation mismatch.
RECOVERY_AGREE3Agreed to restore the saved status.
RECOVERY_REJECT4Rejected to restore the saved state.
ALL_REJECT5Rejected to save the status.

AbilityConstant.StateType

Enumerates the scenarios for saving application data.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
CONTINUATION0Saving the status in continuation.
APP_RECOVERY1Saving the status in application recovery.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙BundleStatusCallback

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

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

harmony 鸿蒙@ohos.bundle (Bundle)

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

harmony 鸿蒙@ohos.WorkSchedulerExtensionAbility (Work Scheduler Callbacks)

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