js-apis-inner-application-continueCallback.md 1.4 KB
Newer Older
1 2
# ContinueCallback

3 4 5 6 7 8 9
The **ContinueCallback** module defines the callback function that indicates the result of mission continuation. For details about mission continuation, see [continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission).

## ContinueCallback.onContinueDone

onContinueDone(result: number): void;

Called when the mission continuation is complete.
10 11 12

**System capability**: SystemCapability.Ability.AbilityRuntime.Mission

13 14 15 16 17
**Parameters**

  | Name| Type| Mandatory| Description|
  | -------- | -------- | -------- | -------- |
  | result |  number | No| Mission continuation result.|
18 19 20 21

**Example**

  ```ts
22
  import distributedMissionManager from '@ohos.distributedMissionManager'
23 24

  let continueDeviceInfo = {
25 26 27 28 29 30
      srcDeviceId: "123",
      dstDeviceId: "456",
      missionId: 123,
      wantParam: {
          "key":"value"
      }
31 32 33 34 35 36
  };

  let continueCallback = {
      onContinueDone(result) {
          console.log('onContinueDone, result: ' + JSON.stringify(result));
      }
37
  };
38 39

  distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
40 41 42 43 44
      if (error && error.code) {
          console.log('continueMission failed, error.code: ' + JSON.stringify(error.code) +
          ' error.message: ' + JSON.stringify(error.message));
      }
      console.log('continueMission finished');
45 46
  })
  ```