harmony 鸿蒙@ohos.application.context (Context)

  • 2022-08-09
  • 浏览 (992)

@ohos.application.context (Context)

The Context 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 context from '@ohos.application.context'

System capability: SystemCapability.Ability.AbilityBase

Name Readable/Writable Type Mandatory Description
AbilityContext Read Only AbilityContext No Level-2 module AbilityContext.
AbilityStageContext Read Only AbilityStageContext No Level-2 module AbilityStageContext.
ApplicationContext Read Only ApplicationContext No Level-2 module ApplicationContext.
BaseContext Read Only BaseContext No Level-2 module BaseContext.
Context Read Only Context No Level-2 module Context.
ExtensionContext Read Only ExtensionContext No Level-2 module ExtensionContext.
FormExtensionContext Read Only FormExtensionContext No Level-2 module FormExtensionContext.
EventHub Read Only EventHub No Level-2 module EventHub.
PermissionRequestResult Read Only PermissionRequestResult No Level-2 module PermissionRequestResult.

Example

let abilityContext: context.AbilityContext;
let abilityStageContext: context.AbilityStageContext;
let applicationContext: context.ApplicationContext;
let baseContext: context.BaseContext;
let context: context.Context;
let extensionContext: context.ExtensionContext;  
let formExtensionContext: context.FormExtensionContext;
let eventHub: context.EventHub;
let permissionRequestResult: context.PermissionRequestResult;

你可能感兴趣的鸿蒙文章

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)

0  赞