From bce8b2861d6dbe71d685a25a483a25238eab05d6 Mon Sep 17 00:00:00 2001 From: wusongqing Date: Thu, 31 Mar 2022 20:24:07 +0800 Subject: [PATCH] updated docs Signed-off-by: wusongqing --- en/application-dev/ability/fa-pageability.md | 15 ++++++++++++++- en/application-dev/ability/stage-ability.md | 12 ++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/en/application-dev/ability/fa-pageability.md b/en/application-dev/ability/fa-pageability.md index 024c339745..461e056572 100644 --- a/en/application-dev/ability/fa-pageability.md +++ b/en/application-dev/ability/fa-pageability.md @@ -33,6 +33,19 @@ Description of ability lifecycle states: You can override the lifecycle callbacks provided by the Page ability in the **app.js/app.ets** file. Currently, the **app.js** file provides only the **onCreate** and **onDestroy** callbacks, and the **app.ets** file provides the full lifecycle callbacks. +### Launch Type +The ability supports three launch types: singleton, multi-instance, and instance-specific. +The **launchType** item in the **config.json** file is used to specify the launch type. + +| Launch Type | Description |Description | +| ----------- | ------- |---------------- | +| stand | Multi-instance | A new instance is started each time an ability starts.| +| singleton | Singleton | Only one instance exists in the system. If an instance already exists when an ability is started, that instance is reused.| +| specified | Instance-specific| The internal service of an ability determines whether to create multiple instances during running.| + +By default, **stand** is used. + + ## Development Guidelines ### Available APIs @@ -69,7 +82,7 @@ You can override the lifecycle callbacks provided by the Page ability in the **a authReadUriPermission: true, // Grant the permission to perform write operations on the URI. authWriteUriPermission: true, - // Support forwarding the Want result to the ability. + // support forwarding the Want result to the ability. abilityForwardResult: true, // Enable abiligy continuation. abilityContinuation: true, diff --git a/en/application-dev/ability/stage-ability.md b/en/application-dev/ability/stage-ability.md index c33df53cad..ec9cf40f0c 100644 --- a/en/application-dev/ability/stage-ability.md +++ b/en/application-dev/ability/stage-ability.md @@ -10,6 +10,18 @@ The stage model is an application development model introduced in API version 9. - Connect to and disconnect from the Service ability. For details, see [Service Extension Ability Development](stage-serviceextension.md). - Continue the application on another device. For details, see [Ability Continuation Development](stage-ability-continuation.md). +### Launch Type +The ability supports three launch types: singleton, multi-instance, and instance-specific. +The **launchType** item in the **module.json** file is used to specify the launch type. + +| Launch Type | Description |Description | +| ----------- | ------- |---------------- | +| stand | Multi-instance | A new instance is started each time an ability starts.| +| singleton | Singleton | Only one instance exists in the system. If an instance already exists when an ability is started, that instance is reused.| +| specified | Instance-specific| The internal service of an ability determines whether to create multiple instances during running.| + +By default, **stand** is used. + ## Available APIs The table below describes the APIs provided by the **AbilityStage** class, which has the **context** attribute. For details about the APIs, see [AbilityStage](../reference/apis/js-apis-application-abilitystage.md). -- GitLab