From ee69ff32bd9f3420fb89c44a5bfda265cdc6317f Mon Sep 17 00:00:00 2001 From: zyjhandsome Date: Wed, 22 Feb 2023 22:28:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=93=BE=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zyjhandsome --- .../subscribe-system-environment-variable-changes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-cn/application-dev/application-models/subscribe-system-environment-variable-changes.md b/zh-cn/application-dev/application-models/subscribe-system-environment-variable-changes.md index 97da46fe2d..b81da7af74 100644 --- a/zh-cn/application-dev/application-models/subscribe-system-environment-variable-changes.md +++ b/zh-cn/application-dev/application-models/subscribe-system-environment-variable-changes.md @@ -14,7 +14,7 @@ [ApplicationContext](../reference/apis/js-apis-inner-application-applicationContext.md)提供了注册回调函数以订阅系统环境变量的变化,并且可以通过调用相应的方法来撤销该回调。这有助于在资源不再需要时释放相关资源,从而提高系统的可靠性和性能。 -1. 使用[ApplicationContext.on()](../reference/apis/js-apis-inner-application-applicationContext.md#applicationcontextontype-environment-callback-environmentcallback)方法订阅系统环境变量的变化,以便应用程序可以动态响应这些变化。例如,可以使用该方法来监测系统语言的变化。 +1. 使用`ApplicationContext.on(type: 'environment', callback: EnvironmentCallback)`方法订阅系统环境变量的变化,以便应用程序可以动态响应这些变化。例如,可以使用该方法来监测系统语言的变化。 ```ts import UIAbility from '@ohos.app.ability.UIAbility'; @@ -48,7 +48,7 @@ } ``` -2. 在资源使用完成之后,可以通过调用[ApplicationContext.off()](../reference/apis/js-apis-inner-application-applicationContext.md#applicationcontextofftype-environment-callbackid-number)方法释放相关资源。 +2. 在资源使用完成之后,可以通过调用`ApplicationContext.off(type: 'environment', callbackId: number)`方法释放相关资源。 ```ts import UIAbility from '@ohos.app.ability.UIAbility'; -- GitLab