• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# AbilityStageContext
2
3> **NOTE**
4>
5> 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.
6
7
8Implements the context of an ability stage. This module is inherited from [Context](js-apis-application-context.md).
9
10## Modules to Import
11
12```js
13import AbilityStage from '@ohos.application.AbilityStage';
14```
15
16## Usage
17
18
19The ability stage context is obtained through an **AbilityStage** instance.
20
21```js
22import AbilityStage from '@ohos.application.AbilityStage';
23class MyAbilityStage extends AbilityStage {
24    onCreate() {
25        let abilityStageContext = this.context;
26    }
27}
28```
29
30
31## Attributes
32
33**System capability**: SystemCapability.Ability.AbilityRuntime.Core
34
35| Name| Type| Readable| Writable| Description|
36| -------- | -------- | -------- | -------- | -------- |
37| currentHapModuleInfo | HapModuleInfo | Yes| No| **ModuleInfo** object corresponding to the **AbilityStage**.|
38| config | [Configuration](js-apis-configuration.md) | Yes| No| Configuration for the environment where the application is running.|
39