diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 3e51a752cf208f97b4105a3996706ff208b951f8..e7da554ae4987995974dba3a108582a7afcfe14e 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -37,7 +37,7 @@ struct Index { private webWidth: number = 0; private webHeight: number = 0; private windowClass: window.Window | null = null; - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; + private context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; private manager: WebDownloadManager = WebDownloadManager.getInstance(); private ctx: UIContext = this.getUIContext(); private options: promptAction.BaseDialogOptions = {