未验证 提交 50de7b11 编写于 作者: Q ql 提交者: Gitee

update zh-cn/application-dev/ability/stage-ability.md.

Signed-off-by: Nql <qianli16@huawei.com>
上级 c72468d8
...@@ -164,6 +164,7 @@ context.startAbility(want, options).then((data) => { ...@@ -164,6 +164,7 @@ context.startAbility(want, options).then((data) => {
``` ```
### 跨设备启动Ability(当前仅对系统应用开放) ### 跨设备启动Ability(当前仅对系统应用开放)
备注:由于DeviceManager getTrustedDeviceListSync接口仅对系统应用开放,当前跨设备启动Ability仅支持系统应用
跨设备场景下,需指定对端设备deviceId,具体示例代码如下: 跨设备场景下,需指定对端设备deviceId,具体示例代码如下:
```ts ```ts
let context = this.context let context = this.context
...@@ -178,7 +179,7 @@ context.startAbility(want).then((data) => { ...@@ -178,7 +179,7 @@ context.startAbility(want).then((data) => {
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具体示例代码如下: 从DeviceManager获取指定设备的deviceId具体示例代码如下:
```ts ```ts
import deviceManager from '@ohos.distributedHardware.deviceManager'; import deviceManager from '@ohos.distributedHardware.deviceManager';
function getRemoteDeviceId() { function getRemoteDeviceId() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册