加入收藏
举报
当前仅显示指定条件回帖 [ 展开查看全部 ]
02-14 20:03
#
文件名称:
ohos-abilityslice.md
所在目录:
Openharmony v1.0 / docs / docs-en / api / api-SmartVision-Devices
文件大小:
10.40 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# OHOS::AbilitySlice
## **Overview**
**Related Modules:**
[AbilityKit](abilitykit.md)
**Description:**
Provides ability slice-related functions, including ability slice lifecycle callbacks and functions for connecting to or disconnecting from ability slices.
**[AbilitySlice](ohos-abilityslice.md)** instances, which are specific to [Feature](feature.md) Abilities \(abilities using the Page template\), are used to present different screens on an application's user interface. A [Feature](feature.md) [Ability](ohos-ability.md) can have multiple ability slices.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Public Member Functions













































Public Member Function Name


Description


OnStart (const Want &want)


virtual void


Called when this ability slice is started. You must override this function if you want to perform some initialization operations during ability slice startup.


OnInactive ()


virtual void


Called when this ability slice enters the STATE_INACTIVE state.


OnActive (const Want &want)


virtual void


Called when this ability slice enters the STATE_ACTIVE state.


OnBackground ()


virtual void


Called when this ability slice enters the STATE_BACKGROUND state.


OnStop ()


virtual void


Called when this ability slice enters the STATE_STOP state.


Present (AbilitySlice &abilitySlice, const Want &want)


void


Presents another ability slice, which can be an ability slice that is not started or an existing ability slice in the host ability.


Terminate ()


void


Destroys this ability slice.


SetUIContent (RootView *rootView)


void


Sets the UI layout for the host ability of this ability slice.


StartAbility (const Want &want)


int


Starts an Ability based on the specified Want information.


StopAbility (const Want &want)


int


Stops an Ability based on the specified Want information.


TerminateAbility ()


int


Destroys this Ability.


ConnectAbility (const Want &want, const IAbilityConnection &conn, void *data)


int


Connects to a Service ability based on the specified Want information.


DisconnectAbility (const IAbilityConnection &conn)


int


Disconnects from a Service ability.


点赞 回复
回帖
支持markdown部分语法 ?