harmony 鸿蒙@ohos.app.ability.common (Context)

  • 2022-12-22
  • 浏览 (628)

@ohos.app.ability.common (Context)

The Common module provides all level-2 module APIs for developers to export.

NOTE

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. The APIs of this module can be used only in the stage model.

Modules to Import

import common from '@ohos.app.ability.common';

Attributes

System capability: SystemCapability.Ability.AbilityRuntime.Core

Name Type Description
UIAbilityContext UIAbilityContext Level-2 module UIAbilityContext.
AbilityStageContext AbilityStageContext Level-2 module AbilityStageContext.
ApplicationContext ApplicationContext Level-2 module ApplicationContext.
BaseContext BaseContext Level-2 module BaseContext.
Context Context Level-2 module Context.
ExtensionContext ExtensionContext Level-2 module ExtensionContext.
FormExtensionContext FormExtensionContext Level-2 module FormExtensionContext.
ServiceExtensionContext ServiceExtensionContext Level-2 module ServiceExtensionContext.
System API: This is a system API and cannot be called by third-party applications.
EventHub EventHub Level-2 module EventHub.
PacMap PacMap Level-2 module PacMap.
AbilityResult AbilityResult Level-2 module AbilityResult.
ConnectOptions ConnectOptions Level-2 module ConnectOptions.

Example

import common from '@ohos.app.ability.common';

let uiAbilityContext: common.UIAbilityContext;
let abilityStageContext: common.AbilityStageContext;
let applicationContext: common.ApplicationContext;
let baseContext: common.BaseContext;
let context: common.Context;
let extensionContext: common.ExtensionContext;
let formExtensionContext: common.FormExtensionContext;
let eventHub: common.EventHub;
let pacMap: common.PacMap;
let abilityResult: common.AbilityResult;
let connectOptions: common.ConnectOptions;

你可能感兴趣的鸿蒙文章

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)

0  赞