参数有baseContext: common.BaseContext,surfaceId: string,common.BaseContext为需要保存状态的UIAbility所对应的context。参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5参考代码写法:camera.getCameraManager(getContext(this) as common.UIAbilityContext); surfaceId为XComponent的surfaceId,起到绑定相应XComponent的作用,代码参考:private mXComponentController: XComponentController = new XComponentController; this.mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 }); let surfaceId = this.mXComponentController.getXComponentSurfaceId()
参数有baseContext: common.BaseContext,surfaceId: string,common.BaseContext为需要保存状态的UIAbility所对应的context。参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5
参考代码写法:
surfaceId为XComponent的surfaceId,起到绑定相应XComponent的作用,代码参考: