diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index e7350757d18873e11c2df8bf9cfecf8059b9cc51..2548f860641b7fa1c0b907ec58c948150b350d7b 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -145,7 +145,7 @@ struct Index { }) .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { if (extraInfo.currentOffset > 0 && index === 0 && !this.slide) { - let context = getContext(this) as common.UIAbilityContext; + let context = this.getUIContext().getHostContext() as common.UIAbilityContext; context.terminateSelf(); } this.slide = true;