js-apis-inner-application-continueCallback.md 1.2 KB
Newer Older
M
m00512953 已提交
1 2
# ContinueCallback

3
表示迁移完成后,返回迁移结果回调函数,可以作为[continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission)的入参监听迁移回调。
M
m00512953 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16

**系统能力**:SystemCapability.Ability.AbilityRuntime.Mission

| 名称                    | 类型       | 可读   | 可写   | 说明                 |
| --------------------- | -------- | ---- | ---- | ------------------ |
| onContinueDone | function | 是    | 否    | 通知迁移完成,返回迁移结果。     |

**示例:**

  ```ts
  import distributedMissionManager from '@ohos.distributedMissionManager';

  let continueDeviceInfo = {
M
mingxihua 已提交
17 18
    srcDeviceId: '123',
    dstDeviceId: '456',
M
m00512953 已提交
19 20
    missionId: 123,
    wantParam: {
M
mingxihua 已提交
21
        'key':'value'
M
m00512953 已提交
22 23 24 25 26 27 28
    }
  };

  let continueCallback = {
      onContinueDone(result) {
          console.log('onContinueDone, result: ' + JSON.stringify(result));
      }
M
mingxihua 已提交
29
  };
M
m00512953 已提交
30 31 32 33 34 35 36 37

  distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
    if (error.code != 0) {
        console.error('continueMission failed, cause: ' + JSON.stringify(error))
    }
    console.info('continueMission finished')
  })
  ```