diff --git a/zh-cn/application-dev/ability/stage-ability.md b/zh-cn/application-dev/ability/stage-ability.md index 25d32c0a69d7cfb516e6ae784e07ca1efa7cb9c5..c3e76afd95ff26f0cfb6c379faa17f145fc8d4a0 100644 --- a/zh-cn/application-dev/ability/stage-ability.md +++ b/zh-cn/application-dev/ability/stage-ability.md @@ -210,14 +210,14 @@ Ability类拥有context属性,context属性为AbilityContext类,AbilityConte **表3** AbilityContext API接口功能介绍 |接口名|描述| |:------|:------| -|startAbility(want: Want, callback: AsyncCallback): void|启动Ability。| -|startAbility(want: Want, options?: StartOptions): Promise|启动Ability。| -|startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void|带AccountId启动Ability。| -|startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise|带AccountId启动Ability。| -|startAbilityForResult(want: Want, callback: AsyncCallback): void|带返回结果启动Ability。| -|startAbilityForResult(want: Want, options?: StartOptions): Promise|带返回结果启动Ability。| -|startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void|带返回结果及AccountId启动Ability。| -|startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise|带返回结果及AccountId启动Ability。| +|startAbility(want: Want, callback: AsyncCallback\): void|启动Ability。| +|startAbility(want: Want, options?: StartOptions): Promise\|启动Ability。| +|startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void|带AccountId启动Ability。| +|startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\|带AccountId启动Ability。| +|startAbilityForResult(want: Want, callback: AsyncCallback\): void|带返回结果启动Ability。| +|startAbilityForResult(want: Want, options?: StartOptions): Promise\|带返回结果启动Ability。| +|startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void|带返回结果及AccountId启动Ability。| +|startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\|带返回结果及AccountId启动Ability。| ### 相同设备启动Ability 应用可以通过`this.context`获取Ability实例的上下文,进而使用AbilityContext中的StartAbility相关接口启动Ability。启动Ability可指定Want、StartOptions、accountId,通过callback形式或promise形式实现。具体示例代码如下: ```ts @@ -247,7 +247,7 @@ var want = { context.startAbility(want).then((data) => { console.log("Succeed to start remote ability with data: " + JSON.stringify(data)) }).catch((error) => { - console.error("Failed to start remote ability with error: "+ JSON.stringify(error)) + console.error("Failed to start remote ability with error: " + JSON.stringify(error)) }) ``` 从DeviceManager获取指定设备的deviceId。具体示例代码如下: diff --git a/zh-cn/application-dev/ability/stage-call.md b/zh-cn/application-dev/ability/stage-call.md index de0ea49f77f0bf61ffd77e99d6a4a45045160eb2..032dacf3309e77ed683d5de558144e42fea02e3a 100644 --- a/zh-cn/application-dev/ability/stage-call.md +++ b/zh-cn/application-dev/ability/stage-call.md @@ -18,11 +18,11 @@ Caller及Callee功能如下:具体的API详见[接口文档](../reference/apis **表1** Call API接口功能介绍 |接口名|描述| |:------|:------| -|startAbilityByCall(want: Want): Promise|获取指定通用组件的Caller通信接口,拉起指定通用组件并将其切换到后台。| +|startAbilityByCall(want: Want): Promise\|获取指定通用组件的Caller通信接口,拉起指定通用组件并将其切换到后台。| |on(method: string, callback: CaleeCallBack): void|通用组件Callee注册method对应的callback方法。| |off(method: string): void|通用组件Callee去注册method的callback方法。| -|call(method: string, data: rpc.Sequenceable): Promise|向通用组件Callee发送约定序列化数据。| -|callWithResult(method: string, data: rpc.Sequenceable): Promise|向通用组件Callee发送约定序列化数据, 并将返回的约定序列化数据带回。| +|call(method: string, data: rpc.Sequenceable): Promise\|向通用组件Callee发送约定序列化数据。| +|callWithResult(method: string, data: rpc.Sequenceable): Promise\|向通用组件Callee发送约定序列化数据, 并将返回的约定序列化数据带回。| |release(): void|释放通用组件的Caller通信接口。| |onRelease(callback: OnReleaseCallBack): void|注册通用组件通信断开监听通知。|