未验证 提交 dfb9cdbf 编写于 作者: O openharmony_ci 提交者: Gitee

!15687 翻译完成:15283 各文件夹readme&website更新

Merge pull request !15687 from wusongqing/TR15283
......@@ -12,10 +12,10 @@
- [Audio Routing and Device Management Development](audio-routing-manager.md)
- [AVPlayer Development (Recommended)](avplayer-playback.md)
- [AVRecorder Development (Recommended)](avrecorder.md)
- [Audio Playback Development](audio-playback.md)
- [Audio Recording Development](audio-recorder.md)
- [Video Playback Development](video-playback.md)
- [Video Recording Development](video-recorder.md)
- [Audio Playback Development (To Be Deprecated)](audio-playback.md)
- [Audio Recording Development (To Be Deprecated)](audio-recorder.md)
- [Video Playback Development (To Be Deprecated)](video-playback.md)
- [Video Recording Development (To Be Deprecated)](video-recorder.md)
- AVSession
- [AVSession Overview](avsession-overview.md)
......
......@@ -3,25 +3,25 @@
The **AbilityMonitor** module provides monitors for abilities that meet specified conditions. The latest matched abilities are stored in an **AbilityMonitor** object.
> **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 are supported and deprecated since API version 9. You are advised to use [abilityMonitor (AbilityMonitor)](js-apis-inner-application-abilityMonitor.md) instead.
## Usage
The ability monitor is set by calling **addAbilityMonitor** in **abilityDelegator**.
The ability monitor can be set by calling **addAbilityMonitor** in **abilityDelegator**.
```js
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
var abilityDelegator;
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
let abilityDelegator;
function onAbilityCreateCallback(data) {
console.info("onAbilityCreateCallback");
}
var monitor = {
let monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
};
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.addAbilityMonitor(monitor, (err : any) => {
......@@ -37,11 +37,13 @@ Describes an ability monitor.
| Name | Type | Readable| Writable| Description |
| ------------------------------------------------------------ | -------- | ---- | ---- | ------------------------------------------------------------ |
| abilityName | string | Yes | Yes | Name of the ability bound to the ability monitor. |
| onAbilityCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. |
| onAbilityForeground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the foreground.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. |
| onAbilityBackground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the background.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. |
| onAbilityDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. |
| onWindowStageCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. |
| onWindowStageRestore?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is restored.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. |
| onWindowStageDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. |
| abilityName | string | Yes | Yes | Name of the ability bound to the ability monitor.|
| moduleName? | string | Yes | Yes | Name of the module bound to the ability monitor.|
| onAbilityCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.|
| onAbilityForeground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the foreground.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.|
| onAbilityBackground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the background.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.|
| onAbilityDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
| onWindowStageCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
| onWindowStageRestore?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is restored.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
| onWindowStageDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
......@@ -10,6 +10,7 @@
- [zlib Error Codes](errorcode-zlib.md)
- Common Event and Notification
- [Event Error Codes](errorcode-CommonEventService.md)
- [Notification Error Codes](errorcode-notification.md)
- [DistributedNotificationService Error Codes](errorcode-DistributedNotificationService.md)
- UI Page
- [Animator Error Codes](errorcode-animator.md)
......@@ -26,7 +27,7 @@
- Resource Management
- [I18N Error Codes](errorcode-i18n.md)
- [Resource Manager Error Codes](errorcode-resource-manager.md)
- Resource Scheduling
- Background Task
- [backgroundTaskManager Error Codes](errorcode-backgroundTaskMgr.md)
- [DeviceUsageStatistics Error Codes](errorcode-DeviceUsageStatistics.md)
- [reminderAgentManager Error Codes](errorcode-reminderAgentManager.md)
......@@ -50,7 +51,6 @@
- Connectivity
- [NFC Error Codes](errorcode-nfc.md)
- [RPC Error Codes](errorcode-rpc.md)
- [Wi-Fi Error Codes](errorcode-wifi.md)
- Basic Features
- [Accessibility Error Codes](errorcode-accessibility.md)
- [FaultLogger Error Codes](errorcode-faultlogger.md)
......@@ -59,7 +59,6 @@
- [HiDebug Error Codes](errorcode-hiviewdfx-hidebug.md)
- [Input Method Framework Error Codes](errorcode-inputmethod-framework.md)
- [Pasteboard Error Codes](errorcode-pasteboard.md)
- [Screen Lock Management Error Codes](errorcode-screenlock.md)
- [Time and Time Zone Service Error Codes](errorcode-time.md)
- [Webview Error Codes](errorcode-webview.md)
- Account Management
......
......@@ -62,6 +62,8 @@
- [ServiceExtensionAbility](application-models/serviceextensionability.md)
- [DataShareExtensionAbility](application-models/datashareextensionability.md)
- [FormExtensionAbility (Widget)](application-models/widget-development-stage.md)
- [AccessibilityExtensionAbility](application-models/accessibilityextensionability.md)
- [WindowExtensionAbility](application-models/windowextensionability.md)
- [AbilityStage Component Container](application-models/abilitystage.md)
- [Context](application-models/application-context-stage.md)
- Want
......@@ -297,10 +299,10 @@
- [Audio Routing and Device Management Development](media/audio-routing-manager.md)
- [AVPlayer Development (Recommended)](media/avplayer-playback.md)
- [AVRecorder Development (Recommended)](media/avrecorder.md)
- [Audio Playback Development](media/audio-playback.md)
- [Audio Recording Development](media/audio-recorder.md)
- [Video Playback Development](media/video-playback.md)
- [Video Recording Development](media/video-recorder.md)
- [Audio Playback Development (To Be Deprecated)](media/audio-playback.md)
- [Audio Recording Development (To Be Deprecated)](media/audio-recorder.md)
- [Video Playback Development (To Be Deprecated)](media/video-playback.md)
- [Video Recording Development (To Be Deprecated)](media/video-recorder.md)
- AVSession
- [AVSession Overview](media/avsession-overview.md)
- [AVSession Development](media/avsession-guidelines.md)
......@@ -887,6 +889,7 @@
- [abilityInfo](reference/apis/js-apis-bundleManager-abilityInfo.md)
- [applicationInfo](reference/apis/js-apis-bundleManager-applicationInfo.md)
- [bundleInfo](reference/apis/js-apis-bundleManager-bundleInfo.md)
- [BundlePackInfo](reference/apis/js-apis-bundleManager-BundlePackInfo.md)
- [dispatchInfo](reference/apis/js-apis-bundleManager-dispatchInfo.md)
- [elementName](reference/apis/js-apis-bundleManager-elementName.md)
- [extensionAbilityInfo](reference/apis/js-apis-bundleManager-extensionAbilityInfo.md)
......@@ -1175,6 +1178,7 @@
- [Resource Manager Error Codes](reference/errorcodes/errorcode-resource-manager.md)
- Resource Scheduling
- [backgroundTaskManager Error Codes](reference/errorcodes/errorcode-backgroundTaskMgr.md)
- [DeviceUsageStatistics Error Codes](reference/errorcodes/errorcode-DeviceUsageStatistics.md)
- [reminderAgentManager Error Codes](reference/errorcodes/errorcode-reminderAgentManager.md)
- [workScheduler Error Codes](reference/errorcodes/errorcode-workScheduler.md)
- Security
......@@ -1223,7 +1227,6 @@
- [System Parameter Error Codes](reference/errorcodes/errorcode-system-parameterV9.md)
- [USB Error Codes](reference/errorcodes/errorcode-usb.md)
- [Update Error Codes](reference/errorcodes/errorcode-update.md)
- [DeviceUsageStatistics Error Codes](reference/errorcodes/errorcode-DeviceUsageStatistics.md)
- Customization Management
- [Enterprise Device Management Error Codes](reference/errorcodes/errorcode-enterpriseDeviceManager.md)
- Language Base Class Library
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册