HarmonyOS 拉起系统钱包应用?

实现拉起钱包应用 如何实现拉起钱包应用的功能,不做服务处理,仅仅是打开钱包首页。

阅读 480
1 个回答

参考demo:

import { common, Want } from '@kit.AbilityKit';

@Entry
@Component
struct StartAblity {
  @State message: string = 'Hello World';

  build() {
    Row() {
      Column() {
        Text(this.message).fontSize(50).fontWeight(FontWeight.Bold).onClick(() => {
          let context = getContext(this) as common.UIAbilityContext;
          let want: Want = { bundleName: 'com.huawei.hmos.wallet', abilityName: 'MainAbility', };
          console.log("want", want)
          context.startAbility(want)
        })
      }.width('100%')
    }.height('100%')
  }
}