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 |
yes |
The changed Configuration object. |
Interface example: