未验证 提交 d48b9830 编写于 作者: O openharmony_ci 提交者: Gitee

!4668 更新跨设备startAbilityForResult示例代码

Merge pull request !4668 from ql/master
...@@ -157,7 +157,7 @@ startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): ...@@ -157,7 +157,7 @@ startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>):
```js ```js
this.context.startAbilityForResult( this.context.startAbilityForResult(
{bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo2"}, {deviceId: "", bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo2"},
(error, result) => { (error, result) => {
console.log("startAbilityForResult AsyncCallback is called, error.code = " + error.code) console.log("startAbilityForResult AsyncCallback is called, error.code = " + error.code)
console.log("startAbilityForResult AsyncCallback is called, result.resultCode = " + result.resultCode) console.log("startAbilityForResult AsyncCallback is called, result.resultCode = " + result.resultCode)
...@@ -189,7 +189,7 @@ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback ...@@ -189,7 +189,7 @@ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback
windowMode: 0, windowMode: 0,
}; };
this.context.startAbilityForResult( this.context.startAbilityForResult(
{bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo2"}, options, {deviceId: "", bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo2"}, options,
(error, result) => { (error, result) => {
console.log("startAbilityForResult AsyncCallback is called, error.code = " + error.code) console.log("startAbilityForResult AsyncCallback is called, error.code = " + error.code)
console.log("startAbilityForResult AsyncCallback is called, result.resultCode = " + result.resultCode) console.log("startAbilityForResult AsyncCallback is called, result.resultCode = " + result.resultCode)
...@@ -226,7 +226,7 @@ startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityRes ...@@ -226,7 +226,7 @@ startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityRes
var options = { var options = {
windowMode: 0, windowMode: 0,
}; };
this.context.startAbilityForResult({bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo2"}, options).then((result) => { this.context.startAbilityForResult({deviceId: "", bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo2"}, options).then((result) => {
console.log("startAbilityForResult Promise.resolve is called, result.resultCode = " + result.resultCode) console.log("startAbilityForResult Promise.resolve is called, result.resultCode = " + result.resultCode)
}, (error) => { }, (error) => {
console.log("startAbilityForResult Promise.Reject is called, error.code = " + error.code) console.log("startAbilityForResult Promise.Reject is called, error.code = " + error.code)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册