From e56eee7429d4f218dd0b645e0928c5f7a5b2f096 Mon Sep 17 00:00:00 2001 From: raul Date: Mon, 29 Aug 2022 22:00:35 +0800 Subject: [PATCH] fix ability foreground failed Signed-off-by: raul Change-Id: I8060a54b475c417091bd0df952671bac298d3e63 --- .../apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts index 9855da30b..f18242941 100644 --- a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -38,7 +38,9 @@ export default class MainAbility2 extends Ability { windowStage.setUIContent(this.context, "pages/index", null) windowStage.on('windowStageEvent', (data)=>{ if(data == 2){ - commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); + setTimeout(()=>{ + commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); + }, 2000) } }) } -- GitLab