HarmonyOS 如何跳转设置的通知管理页?

如题:HarmonyOS 如何跳转设置的通知管理页?

阅读 536
1 个回答

拉起设置常用页面参考:

https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs-V5/faqs-ability-kit-V5\#section858910165268

代码示例:

1)拉起应用设置详情页

let context = getContext(this) as common.UIAbilityContext;
let want: Want = {
  bundleName: 'com.huawei.hmos.settings',
  abilityName: 'com.huawei.hmos.settings.MainAbility',
  uri: 'application_info_entry',
  parameters: {
    pushParams: context.applicationInfo.name // 应用包名
  }
};
context.startAbility(want)

2)拉起通知管理页:

let context = getContext(this) as common.UIAbilityContext;
let want: Want = {
  bundleName: 'com.huawei.hmos.settings',
  abilityName: 'com.huawei.hmos.settings.MainAbility',
  uri: 'systemui_notification_settings',
  parameters: {
    pushParams: context.applicationInfo.name // 应用包名
  }
};
context.startAbility(want)
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
HarmonyOS
子站问答
访问
宣传栏