harmony 鸿蒙DriverExtensionContext
DriverExtensionContext
The DriverExtensionContext module provides the context of DriverExtensionAbility. It inherits from ExtensionContext.
The DriverExtensionContext module provides the operations that need to be actively initiated in the DriverExtensionAbility implementation.
NOTE
- The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
- The APIs of this module can be used only in the stage model.
Modules to Import
import { common } from '@kit.AbilityKit';
How to Use
Before using DriverExtensionContext, you need to obtain it through a DriverExtensionAbility child class instance.
import { DriverExtensionAbility, DriverExtensionContext } from '@kit.DriverDevelopmentKit';
let context : DriverExtensionContext|undefined;
class EntryAbility extends DriverExtensionAbility {
onInit() {
context = this.context; // Obtain DriverExtensionContext.
}
}
DriverExtensionContext.updateDriverState
updateDriverState(): void;
Updates the driver state. This interface is reserved and does not provide specific functionality currently.
System capability: SystemCapability.Driver.ExternalDevice
Example
if (context != null) {
context.updateDriverState();
}
你可能感兴趣的鸿蒙文章
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦