diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index ed58dd6f9b85f4553815ab6b81e1d269b675ca0e..9e23787b033ce1da81a6f606859923f831da603c 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -64,6 +64,7 @@ struct Index { .onClick(() => { // [Start testNapi_thread_safe_case] testNapi.threadSafeCase(this.work); + this.getUIContext().getPromptAction().showToast({ // [End testNapi_thread_safe_case] promptAction.showToast({ message: $r('app.string.threadSafe_message'), @@ -75,7 +76,7 @@ struct Index { .margin({ top: 12 }) .onClick(() => { testNapi.libUvCase(this.work); - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.libUV_message'), duration: 2000 })