openharmony 鸿蒙 js-apis-ability-wantConstant

2025-06-12 浏览 (1)

@ohos.ability.wantConstant (wantConstant)

The wantConstant module provides the actions, entities, and flags used in Want objects.

NOTE

The APIs of this module are supported since API version 6 and deprecated since API version 9. You are advised to use @ohos.app.ability.wantConstant instead. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import wantConstant from '@ohos.ability.wantConstant';

Action

Enumerates the action constants of the Want object. action specifies the operation to execute.

System capability: SystemCapability.Ability.AbilityBase

NameValueDescription
ACTION_HOMEohos.want.action.homeAction of returning to the home page.
ACTION_DIALohos.want.action.dialAction of launching the numeric keypad.
ACTION_SEARCHohos.want.action.searchAction of launching the search function.
ACTION_WIRELESS_SETTINGSohos.settings.wirelessAction of launching the UI that provides wireless network settings, for example, Wi-Fi options.
ACTION_MANAGE_APPLICATIONS_SETTINGSohos.settings.manage.applicationsAction of launching the UI for managing installed applications.
ACTION_APPLICATION_DETAILS_SETTINGSohos.settings.application.detailsAction of launching the UI that displays the details of an application.
ACTION_SET_ALARMohos.want.action.setAlarmAction of launching the UI for setting the alarm clock.
ACTION_SHOW_ALARMSohos.want.action.showAlarmsAction of launching the UI that displays all alarms.
ACTION_SNOOZE_ALARMohos.want.action.snoozeAlarmAction of launching the UI for snoozing an alarm.
ACTION_DISMISS_ALARMohos.want.action.dismissAlarmAction of launching the UI for deleting an alarm.
ACTION_DISMISS_TIMERohos.want.action.dismissTimerAction of launching the UI for dismissing a timer.
ACTION_SEND_SMSohos.want.action.sendSmsAction of launching the UI for sending an SMS message.
ACTION_CHOOSEohos.want.action.chooseAction of launching the UI for opening a contact or picture.
ACTION_IMAGE_CAPTURE8+ohos.want.action.imageCaptureAction of launching the UI for photographing.
ACTION_VIDEO_CAPTURE8+ohos.want.action.videoCaptureAction of launching the UI for shooting a video.
ACTION_SELECTohos.want.action.selectAction of launching the UI for application selection.
ACTION_SEND_DATAohos.want.action.sendDataAction of launching the UI for sending a single data record.
ACTION_SEND_MULTIPLE_DATAohos.want.action.sendMultipleDataAction of launching the UI for sending multiple data records.
ACTION_SCAN_MEDIA_FILEohos.want.action.scanMediaFileAction of requesting a media scanner to scan a file and add the file to the media library.
ACTION_VIEW_DATAohos.want.action.viewDataAction of viewing data.
ACTION_EDIT_DATAohos.want.action.editDataAction of editing data.
INTENT_PARAMS_INTENTability.want.params.INTENTAction of displaying selection options with an action selector.
INTENT_PARAMS_TITLEability.want.params.TITLETitle of the character sequence dialog box used with the action selector.
ACTION_FILE_SELECT7+ohos.action.fileSelectAction of selecting a file.
PARAMS_STREAM7+ability.params.streamURI of the data stream associated with the target when the data is sent. The value must be an array of the string type.
ACTION_APP_ACCOUNT_OAUTH 8+ohos.account.appAccount.action.oauthAction of providing the OAuth service.

Entity

Enumerates the entity constants of the Want object. entity specifies additional information of the target ability.

System capability: SystemCapability.Ability.AbilityBase

NameValueDescription
ENTITY_DEFAULTentity.system.defaultDefault entity. The default entity is used if no entity is specified.
ENTITY_HOMEentity.system.homeHome screen entity.
ENTITY_VOICEentity.system.voiceVoice interaction entity.
ENTITY_BROWSABLEentity.system.browsableBrowser type entity.
ENTITY_VIDEOentity.system.videoVideo type entity.

Flags

Enumerates the flags that specify how the Want will be handled.

System capability: SystemCapability.Ability.AbilityBase

NameValueDescription
FLAG_AUTH_READ_URI_PERMISSION0x00000001Grants the permission to read the URI.
FLAG_AUTH_WRITE_URI_PERMISSION0x00000002Grants the permission to write data to the URI.
FLAG_ABILITY_FORWARD_RESULT0x00000004Returns the result to the ability.
FLAG_ABILITY_CONTINUATION0x00000008Indicates whether the ability on the local device can be continued on a remote device.
FLAG_NOT_OHOS_COMPONENT0x00000010Indicates that a component does not belong to OHOS.
FLAG_ABILITY_FORM_ENABLED0x00000020Indicates that an ability is enabled.
FLAG_ABILITYSLICE_MULTI_DEVICE0x00000100Indicates the support for cross-device startup in the distributed scheduler.
FLAG_START_FOREGROUND_ABILITY0x00000200Indicates that the ServiceAbility is started regardless of whether the host application has been started.
FLAG_INSTALL_ON_DEMAND0x00000800Indicates that the specific ability will be installed if it has not been installed.
FLAG_INSTALL_WITH_BACKGROUND_MODE0x80000000Indicates that the specific ability will be installed in the background if it has not been installed.
FLAG_ABILITY_CLEAR_MISSION0x00008000Clears other operation missions. This flag can be set for Want passed in startAbility. It must be used together with FLAG_ABILITY_NEW_MISSION.
FLAG_ABILITY_NEW_MISSION0x10000000Creates a mission on the history mission stack.
FLAG_ABILITY_MISSION_TOP0x20000000Reuses an ability instance if it is on the top of an existing mission stack; creates an ability instance otherwise.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit

harmony 鸿蒙AbilityAccessControl

harmony 鸿蒙AbilityBase

harmony 鸿蒙AbilityBase_Element

harmony 鸿蒙AbilityRuntime

harmony 鸿蒙bundle

harmony 鸿蒙OH_NativeBundle_ApplicationInfo

harmony 鸿蒙OH_NativeBundle_ElementName

harmony 鸿蒙ability_access_control.h

harmony 鸿蒙ability_base_common.h

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