提交 93ffa4e6 编写于 作者: X xinking129

modify code

Signed-off-by: Nxinking129 <xinxin13@huawei.com>
上级 ee10ffb1
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityStage from "@ohos.app.ability.AbilityStage" import AbilityStage from "@ohos.app.ability.AbilityStage";
export default class MyAbilityStage extends AbilityStage { export default class MyAbilityStage extends AbilityStage {
onCreate() { onCreate() {
console.info("ActsStageContextAssistOne StageAbility onCreate") console.info("ActsStageContextAssistOne StageAbility onCreate");
globalThis.abilityStageContextA = this.context; globalThis.abilityStageContextA = this.context;
} }
} }
\ No newline at end of file
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,28 +13,28 @@ ...@@ -13,28 +13,28 @@
* limitations under the License. * limitations under the License.
*/ */
import Ability from '@ohos.app.ability.UIAbility' import Ability from '@ohos.app.ability.UIAbility';
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent';
export default class DrawnAbility extends Ability { export default class DrawnAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.info('ActsStageContextAssistOne DrawnAbility onCreate') console.info('ActsStageContextAssistOne DrawnAbility onCreate');
this.context.reportDrawnCompleted(() => { this.context.reportDrawnCompleted(() => {
console.info('The call to the reportDrawnCompleted interface succeeded'); console.info('The call to the reportDrawnCompleted interface succeeded');
}); });
} }
onDestroy() { onDestroy() {
console.info('ActsStageContextAssistOne DrawnAbility onDestroy') console.info('ActsStageContextAssistOne DrawnAbility onDestroy');
} }
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.info('ActsStageContextAssistOne DrawnAbility onWindowStageCreate'); console.info('ActsStageContextAssistOne DrawnAbility onWindowStageCreate');
windowStage.setUIContent(this.context, 'pages/index', null) windowStage.setUIContent(this.context, 'pages/index', null);
} }
onWindowStageDestroy() { onWindowStageDestroy() {
console.info('ActsStageContextAssistOne DrawnAbility onWindowStageDestroy') console.info('ActsStageContextAssistOne DrawnAbility onWindowStageDestroy');
} }
onForeground() { onForeground() {
...@@ -42,7 +42,7 @@ export default class DrawnAbility extends Ability { ...@@ -42,7 +42,7 @@ export default class DrawnAbility extends Ability {
globalThis.abilityContextA = this.context; globalThis.abilityContextA = this.context;
commonEvent.publish("StartDrawnAbility_CommonEvent_ContextOne", () => { commonEvent.publish("StartDrawnAbility_CommonEvent_ContextOne", () => {
console.log("Publish StartDrawnAbility_CommonEvent_ContextOne callback"); console.log("Publish StartDrawnAbility_CommonEvent_ContextOne callback");
}) });
} }
onBackground() { onBackground() {
......
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册