js-apis-inner-ability-abilityResult.md 1.4 KB
Newer Older
1 2
# AbilityResult

G
Gloria 已提交
3
The **AbilityResult** module defines the result code and data returned when an ability is terminated after being started. You can use [startAbilityForResult](js-apis-ability-featureAbility.md#featureabilitystartabilityforresult7) to obtain the **AbilityResult** object returned after the started ability is terminated. The started ability returns the **AbilityResult** object by calling [terminateSelfWithResult](js-apis-ability-featureAbility.md#featureabilityterminateselfwithresult7).
4 5 6 7 8

> **NOTE**
>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.

G
Gloria 已提交
9 10 11 12 13 14
## Modules to Import

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

15 16 17 18
**System capability**: SystemCapability.Ability.AbilityBase

| Name       | Readable   | Writable    | Type                | Mandatory| Description                                                        |
| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ |
G
Gloria 已提交
19 20
| resultCode    | Yes   | No     | number               | No  | Result code returned when the ability is started or terminated.                               |
| want   | Yes   | No     | [Want](./js-apis-app-ability-want.md)               | No  | Data returned when the ability is terminated.|