harmony 鸿蒙@ohos.ability.wantConstant (wantConstant)

2022-08-09 浏览 (1032)

@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';

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.

wantConstant.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.

wantConstant.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_AUTH_PERSISTABLE_URI_PERMISSION0x00000040Grants the permission to make the URI persistent.
System API: This is a system API and cannot be called by third-party applications.
FLAG_AUTH_PREFIX_URI_PERMISSION0x00000080Grants the permission to verify URIs by prefix matching.
System API: This is a system API and cannot be called by third-party applications.
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_ABILITY_CONTINUATION_REVERSIBLE0x00000400Indicates that ability continuation is reversible.
System API: This is a system API and cannot be called by third-party applications.
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 in the startAbility API passed to the FeatureAbility module. 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 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

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