修复安装表盘按键失效bug 3265/5 3265/head 3267/target/1
authorluozheng <1732036298@qq.com>
Thu, 12 Mar 2026 07:53:53 +0000 (15:53 +0800)
committerluozheng <1732036298@qq.com>
Thu, 12 Mar 2026 07:53:53 +0000 (15:53 +0800)
code/sdk/application/wearable/n9/nativeabilityfwk/src/AbilitySlice.cpp

index 13bdd52..7c81e3f 100644 (file)
@@ -43,6 +43,12 @@ void AbilitySlice::OnStart()
 
 void AbilitySlice::OnResume()
 {
+
+    if(NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAIN || NativeAbility::GetInstance().GetCurSliceId() == VIEW_APPLIST)
+    {
+        RootView::GetInstance()->SetOnKeyActListener(KeyInputListener::GetInstance());
+    }
+
     if ((state_ != SliceState::START) && (state_ != SliceState::PAUSE)) { // avoid repeated resume
         return;
     }