HarmonyOS/OpenHarmony application development-Stage model ArkTS language EnvironmentCallback

The EnvironmentCallback module provides the application context ApplicationContext the ability to monitor and call back changes in the system environment, including the onConfigurationUpdated method.

Description :

The first interfaces of the module are supported from API version 9. The module interface is only available under the Stage model.

import module :

import EnvironmentCallback from "@ohos.app.ability.EnvironmentCallback";

EnvironmentCallback.onConfigurationUpdated

onConfigurationUpdated(config: Configuration): void;

After registering the listener for system environment changes, a callback is triggered when the system environment changes.

parameter name

type

required

illustrate

config

Configuration

yes

The changed Configuration object.

Interface example:

 

Guess you like

Origin blog.csdn.net/weixin_69135651/article/details/130147569