Provides ability slice-related functions, including ability slice lifecycle callbacks and functions for connecting to or disconnecting from ability slices.
AbilitySlice instances, which are specific to Feature Abilities (abilities using the Page template), are used to present different screens on an application’s user interface. A FeatureAbility can have multiple ability slices.
Public Member Functions
Public Member Function Name
OnStart (const Want &want)
Called when this ability slice is started. You must override this function if you want to perform some initialization operations during ability slice startup.
Called when this ability slice enters the STATE_INACTIVE state.
OnActive (const Want &want)
Called when this ability slice enters the STATE_ACTIVE state.
Called when this ability slice enters the STATE_BACKGROUND state.
Called when this ability slice enters the STATE_STOP state.
Present (AbilitySlice &abilitySlice, const Want &want)
Presents another ability slice, which can be an ability slice that is not started or an existing ability slice in the host ability.
Destroys this ability slice.
Sets the UI layout for the host ability of this ability slice.
StartAbility (const Want &want)
Starts an Ability based on the specified Want information.
StopAbility (const Want &want)
Stops an Ability based on the specified Want information.
Destroys this Ability.
ConnectAbility (const Want &want, const IAbilityConnection &conn, void data)
Connects to a Service ability based on the specified Want information.
DisconnectAbility (const IAbilityConnection &conn)
Disconnects from a Service ability.