From 137a6761c28496ddf57d8bb207d9d16d29bea7ce Mon Sep 17 00:00:00 2001 From: raul Date: Mon, 29 Aug 2022 22:00:35 +0800 Subject: [PATCH] fixed e56eee7 from https://gitee.com/raulnaruto/xts_acts/pulls/5299 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