js-apis-inner-application-continueCallback.md 1.3 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
      srcDeviceId: '123',
      dstDeviceId: '456',
27 28
      missionId: 123,
      wantParam: {
29
          'key':'value'
30
      }
31 32 33 34
  };

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

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