openharmony 鸿蒙 js-apis-bundleManager-shortcutInfo

2026-08-25 浏览 (1)

ShortcutInfo

The module describes the shortcut information defined in the module.json5 file of an application. The information can be obtained by running getAllShortcutInfoForSelf or getShortcutInfo.

NOTE

The initial APIs of this module are supported since API version 20. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import { shortcutManager } from '@kit.AbilityKit';

ShortcutWant

Describes a collection of target Wants information defined within a shortcut.

System capability: SystemCapability.BundleManager.BundleFramework.Launcher

NameTypeRead-OnlyOptionalDescription
targetBundlestringNoNoTarget bundle name of the shortcut.
targetModulestringNoYesTarget module name of the shortcut.
targetAbilitystringNoNoTarget ability name of the shortcut.
parametersArray<ParameterItem>NoYesCustom data for launching the shortcut. The data must be strings. Both keys and values can be strings up to 1024 characters long.

ShortcutInfo

Describes the configuration information for a shortcut.

System capability: SystemCapability.BundleManager.BundleFramework.Launcher

NameTypeRead-OnlyOptionalDescription
idstringNoNoID of the shortcut.
bundleNamestringNoNoBundle name of the application to which the shortcut belongs.
moduleNamestringNoYesModule name of the shortcut.
hostAbilitystringNoYesName of the ability that hosts the shortcut.
iconstringNoYesIcon of the shortcut. The value is the index of a resource file.
iconIdnumberNoYesResource ID of the shortcut icon.
labelstringNoYesLabel of the shortcut. The value can be descriptive text or a resource index.
labelIdnumberNoYesResource ID of the shortcut label.
wantsArray<ShortcutWant>NoYesA collection of target Wants information defined within the shortcut.
appIndexnumberNoNoIndex of the application clone to which the shortcut belongs.
sourceTypenumberNoNoSource type of the shortcut. The value 0 means a custom shortcut, 1 means a static shortcut, and 2 means a dynamic shortcut. Dynamic shortcuts are supported since API version 23.
visiblebooleanNoYesWhether the shortcut is visible. true if visible, false otherwise. The default value is true.

ParameterItem

Describes the custom data in the shortcut configuration. You can define your own key-value pairs, and obtain the values using the keys.

System capability: SystemCapability.BundleManager.BundleFramework.Launcher

NameTypeRead-OnlyOptionalDescription
keystringNoNoKey of the custom data.
valuestringNoNoValue of the custom data.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 js-apis-app-ability-appServiceExtensionAbility

openharmony 鸿蒙 js-apis-inner-wantAgent-triggerInfo-sys

openharmony 鸿蒙 js-apis-inner-wantAgent-wantAgentInfo-sys

openharmony 鸿蒙 js-apis-appControl-sys

openharmony 鸿蒙 js-apis-app-ability-environmentCallback

openharmony 鸿蒙 js-apis-inner-application-missionInfo-sys

openharmony 鸿蒙 js-apis-bundleManager-sharedBundleInfo-sys

openharmony 鸿蒙 js-apis-inner-application-continueMissionInfo-sys

openharmony 鸿蒙 js-apis-inner-application-appServiceExtensionContext

openharmony 鸿蒙 js-apis-bundleManager-businessAbilityInfo-sys

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/EYzGHMaN