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

!12212 Translation finished: 11150【元能力】Stage模型ServiceExtensionContext API错误码资料更新

Merge pull request !12212 from wusongqing/TR11150
......@@ -2,9 +2,9 @@
## When to Use
Ability call is an extension of the ability capability. It enables an ability to be invoked by and communicate with external systems. The ability invoked can be either started in the foreground or created and run in the background. You can use the ability call to implement data sharing between two abilities (caller ability and callee ability) through inter-process communication (IPC).
The core API used for the ability call is `startAbilityByCall`, which differs from `startAbility` in the following ways:
- `startAbilityByCall` supports ability startup in the foreground and background, whereas `startAbility` supports ability startup in the foreground only.
- The caller ability can use the `Caller` object returned by `startAbilityByCall` to communicate with the callee ability, but `startAbility` does not provide the communication capability.
The core API used for the ability call is **startAbilityByCall**, which differs from **startAbility** in the following ways:
- **startAbilityByCall** supports ability startup in the foreground and background, whereas **startAbility** supports ability startup in the foreground only.
- The caller ability can use the **Caller** object returned by **startAbilityByCall** to communicate with the callee ability, but **startAbility** does not provide the communication capability.
Ability call is usually used in the following scenarios:
- Communicating with the callee ability
......@@ -15,17 +15,17 @@ Ability call is usually used in the following scenarios:
|:------|:------|
|Caller ability|Ability that triggers the ability call.|
|Callee ability|Ability invoked by the ability call.|
|Caller |Object returned by `startAbilityByCall` and used by the caller ability to communicate with the callee ability.|
|Caller |Object returned by **startAbilityByCall** and used by the caller ability to communicate with the callee ability.|
|Callee |Object held by the callee ability to communicate with the caller ability.|
|IPC |Inter-process communication.|
The ability call process is as follows:
- The caller ability uses `startAbilityByCall` to obtain a `Caller` object and uses `call()` of the `Caller` object to send data to the callee ability.
- The callee ability, which holds a `Callee` object, uses `on()` of the `Callee` object to register a callback. This callback is invoked when the callee ability receives data from the caller ability.
- The caller ability uses **startAbilityByCall** to obtain a **Caller** object and uses **call()** of the **Caller** object to send data to the callee ability.
- The callee ability, which holds a **Callee** object, uses **on()** of the **Callee** object to register a callback. This callback is invoked when the callee ability receives data from the caller ability.
![stage-call](figures/stage-call.png)
> **NOTE**<br/>
> The launch type of the callee ability must be `singleton`.
> The launch type of the callee ability must be **singleton**.
> Currently, only system applications can use the ability call.
## Available APIs
......@@ -34,30 +34,29 @@ The table below describes the ability call APIs. For details, see [Ability](../r
**Table 2** Ability call APIs
|API|Description|
|:------|:------|
|startAbilityByCall(want: Want): Promise\<Caller>|Starts an ability in the foreground (through the `want` configuration) or background (default) and obtains the `Caller` object for communication with the ability. For details, see [AbilityContext](../reference/apis/js-apis-ability-context.md#abilitycontextstartabilitybycall) or [ServiceExtensionContext](../reference/apis/js-apis-service-extension-context.md#serviceextensioncontextstartabilitybycall).|
|startAbilityByCall(want: Want): Promise\<Caller>|Starts an ability in the foreground (through the **want** configuration) or background (default) and obtains the **Caller** object for communication with the ability. For details, see [AbilityContext](../reference/apis/js-apis-ability-context.md#abilitycontextstartabilitybycall) or [ServiceExtensionContext](../reference/apis/js-apis-service-extension-context.md#serviceextensioncontextstartabilitybycall).|
|on(method: string, callback: CalleeCallBack): void|Callback invoked when the callee ability registers a method.|
|off(method: string): void|Callback invoked when the callee ability deregisters a method.|
|call(method: string, data: rpc.Sequenceable): Promise\<void>|Sends agreed sequenceable data to the callee ability.|
|callWithResult(method: string, data: rpc.Sequenceable): Promise\<rpc.MessageParcel>|Sends agreed sequenceable data to the callee ability and obtains the agreed sequenceable data returned by the callee ability.|
|release(): void|Releases the `Caller` object.|
|onRelease(callback: OnReleaseCallBack): void|Callback invoked when the `Caller` object is released.|
|release(): void|Releases the **Caller** object.|
|on(type: "release", callback: OnReleaseCallback): void|Callback invoked when the **Caller** object is released.|
## How to Develop
The procedure for developing the ability call is as follows:
1. Create a callee ability.
2. Access the callee ability.
> **NOTE**
>
> The code snippets provided in the **How to Develop** section are used to show specific development steps. They may not be able to run independently.
### Creating a Callee Ability
For the callee ability, implement the callback to receive data and the methods to marshal and unmarshal data. When data needs to be received, use `on()` to register a listener. When data does not need to be received, use `off()` to deregister the listener.
For the callee ability, implement the callback to receive data and the methods to marshal and unmarshal data. When data needs to be received, use **on()** to register a listener. When data does not need to be received, use **off()** to deregister the listener.
**1. Configure the ability launch type.**
Set `launchType` of the callee ability to `singleton` in the `module.json5` file.
Set **launchType** of the callee ability to **singleton** in the **module.json5** file.
|JSON Field|Description|
|:------|:------|
|"launchType"|Ability launch type. Set this parameter to `singleton`.|
|"launchType"|Ability launch type. Set this parameter to **singleton**.|
An example of the ability configuration is as follows:
```json
......@@ -73,7 +72,7 @@ An example of the ability configuration is as follows:
```
**2. Import the Ability module.**
```ts
import Ability from '@ohos.application.Ability'
import Ability from '@ohos.app.ability.UIAbility'
```
**3. Define the agreed sequenceable data.**
......@@ -101,9 +100,9 @@ export default class MySequenceable {
}
}
```
**4. Implement `Callee.on` and `Callee.off`.**
**4. Implement Callee.on and Callee.off.**
The time to register a listener for the callee ability depends on your application. The data sent and received before the listener is registered and that after the listener is deregistered are not processed. In the following example, the `MSG_SEND_METHOD` listener is registered in `onCreate` of the ability and deregistered in `onDestroy`. After receiving sequenceable data, the application processes the data and returns the data result. You need to implement processing based on service requirements. The code snippet is as follows:
The time to register a listener for the callee ability depends on your application. The data sent and received before the listener is registered and that after the listener is deregistered are not processed. In the following example, the **MSG_SEND_METHOD** listener is registered in **onCreate** of the ability and deregistered in **onDestroy**. After receiving sequenceable data, the application processes the data and returns the data result. You need to implement processing based on service requirements. The code snippet is as follows:
```ts
const TAG: string = '[CalleeAbility]'
const MSG_SEND_METHOD: string = 'CallSendMsg'
......@@ -143,16 +142,16 @@ export default class CalleeAbility extends Ability {
### Accessing the Callee Ability
**1. Import the Ability module.**
```ts
import Ability from '@ohos.application.Ability'
import Ability from '@ohos.app.ability.UIAbility'
```
**2. Obtain the `Caller` object.**
**2. Obtain the Caller object.**
The `context` attribute of the ability implements `startAbilityByCall` to obtain the `Caller` object for communication. The following example uses `this.context` to obtain the `context` attribute of the ability, uses `startAbilityByCall` to start the callee ability, obtain the `Caller` object, and register the `onRelease` listener of the caller ability. You need to implement processing based on service requirements. The code snippet is as follows:
The **context** attribute of the ability implements **startAbilityByCall** to obtain the **Caller** object for communication. The following example uses **this.context** to obtain the **context** attribute of the ability, uses **startAbilityByCall** to start the callee ability, obtain the **Caller** object, and register the **onRelease** listener of the caller ability. You need to implement processing based on service requirements. The code snippet is as follows:
```ts
// Register the onRelease listener of the caller ability.
private regOnRelease(caller) {
try {
caller.onRelease((msg) => {
caller.on("release", (msg) => {
console.log(`caller onRelease is called ${msg}`)
})
console.log('caller register OnRelease succeed')
......@@ -193,7 +192,7 @@ async onButtonGetRemoteCaller() {
caller = data
console.log('get remote caller success')
// Register the onRelease listener of the caller ability.
caller.onRelease((msg) => {
caller.on("release", (msg) => {
console.log(`remote caller onRelease is called ${msg}`)
})
console.log('remote caller register OnRelease succeed')
......@@ -203,7 +202,7 @@ async onButtonGetRemoteCaller() {
})
}
```
Obtain the ID of the peer device from `DeviceManager`. Note that the `getTrustedDeviceListSync` API is open only to system applications. The code snippet is as follows:
Obtain the ID of the peer device from **DeviceManager**. Note that the **getTrustedDeviceListSync** API is open only to system applications. The code snippet is as follows:
```ts
import deviceManager from '@ohos.distributedHardware.deviceManager';
var dmClass;
......@@ -248,7 +247,7 @@ async onButtonCall() {
}
```
In the following, `CallWithResult` is used to send data `originMsg` to the callee ability and assign the data processed by the `CallSendMsg` method to `backMsg`. The code snippet is as follows:
In the following, **CallWithResult** is used to send data **originMsg** to the callee ability and assign the data processed by the **CallSendMsg** method to **backMsg**. The code snippet is as follows:
```ts
const MSG_SEND_METHOD: string = 'CallSendMsg'
originMsg: string = ''
......@@ -268,9 +267,9 @@ async onButtonCallWithResult(originMsg, backMsg) {
}
}
```
**4. Release the `Caller` object.**
**4. Release the Caller object.**
When the `Caller` object is no longer required, use `release()` to release it. The code snippet is as follows:
When the **Caller** object is no longer required, use **release()** to release it. The code snippet is as follows:
```ts
releaseCall() {
try {
......
......@@ -46,7 +46,7 @@ Called to initialize the service logic when an ability is created.
**Example**
```js
```ts
class myAbility extends Ability {
onCreate(want, param) {
console.log('onCreate, want:' + want.abilityName);
......@@ -71,7 +71,7 @@ Called when a **WindowStage** is created for this ability.
**Example**
```js
```ts
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
......@@ -90,7 +90,7 @@ Called when the **WindowStage** is destroyed for this ability.
**Example**
```js
```ts
class myAbility extends Ability {
onWindowStageDestroy() {
console.log('onWindowStageDestroy');
......@@ -115,7 +115,7 @@ Called when the **WindowStage** is restored during the migration of this ability
**Example**
```js
```ts
class myAbility extends Ability {
onWindowStageRestore(windowStage) {
console.log('onWindowStageRestore');
......@@ -134,7 +134,7 @@ Called when this ability is destroyed to clear resources.
**Example**
```js
```ts
class myAbility extends Ability {
onDestroy() {
console.log('onDestroy');
......@@ -153,7 +153,7 @@ Called when this ability is switched from the background to the foreground.
**Example**
```js
```ts
class myAbility extends Ability {
onForeground() {
console.log('onForeground');
......@@ -172,7 +172,7 @@ Called when this ability is switched from the foreground to the background.
**Example**
```js
```ts
class myAbility extends Ability {
onBackground() {
console.log('onBackground');
......@@ -203,7 +203,7 @@ Called to save data during the ability migration preparation process.
**Example**
```js
```ts
import AbilityConstant from "@ohos.application.AbilityConstant"
class myAbility extends Ability {
onContinue(wantParams) {
......@@ -232,7 +232,7 @@ Called when the ability startup mode is set to singleton.
**Example**
```js
```ts
class myAbility extends Ability {
onNewWant(want) {
console.log('onNewWant, want:' + want.abilityName);
......@@ -257,7 +257,7 @@ Called when the configuration of the environment where the ability is running is
**Example**
```js
```ts
class myAbility extends Ability {
onConfigurationUpdated(config) {
console.log('onConfigurationUpdated, config:' + JSON.stringify(config));
......@@ -281,7 +281,7 @@ Dumps client information.
**Example**
```js
```ts
class myAbility extends Ability {
dump(params) {
console.log('dump, params:' + JSON.stringify(params));
......@@ -306,7 +306,7 @@ Called when the system has decided to adjust the memory level. For example, this
**Example**
```js
```ts
class myAbility extends Ability {
onMemoryLevel(level) {
console.log('onMemoryLevel, level:' + JSON.stringify(level));
......@@ -315,12 +315,47 @@ Called when the system has decided to adjust the memory level. For example, this
```
## Ability.onSaveState
onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult;
Called when the framework saves the ability state in the case of an application fault if automatic saving is enabled. This API is used together with [appRecovery](js-apis-app-ability-appRecovery.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reason | [AbilityConstant.StateType](js-apis-application-abilityConstant.md#abilityconstantstatetype) | Yes| Reason for triggering the callback to save the ability state.|
| wantParam | {[key:&nbsp;string]:&nbsp;any} | Yes| **want** parameter.|
**Return value**
| Type| Description|
| -------- | -------- |
| AbilityConstant.OnSaveResult | Whether the ability state is saved.|
**Example**
```js
import AbilityConstant from '@ohos.application.AbilityConstant'
class myAbility extends Ability {
onSaveState(reason, wantParam) {
console.log('onSaveState');
wantParam["myData"] = "my1234567";
return AbilityConstant.OnSaveResult.RECOVERY_AGREE;
}
}
```
## Caller
Implements sending of sequenceable data to the target ability when an ability (caller ability) invokes the target ability (callee ability).
## Caller.call
call(method: string, data: rpc.Sequenceable): Promise&lt;void&gt;;
......@@ -342,10 +377,20 @@ Sends sequenceable data to the target ability.
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return a response.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. |
| 401 | Invalid input parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
**Example**
```js
import Ability from '@ohos.application.Ability';
```ts
import Ability from '@ohos.app.ability.UIAbility';
class MyMessageAble{ // Custom sequenceable data structure
name:""
str:""
......@@ -377,19 +422,20 @@ Sends sequenceable data to the target ability.
deviceId: ""
}).then((obj) => {
caller = obj;
let msg = new MyMessageAble(1, "world"); // See the definition of Sequenceable.
let msg = new MyMessageAble("msg", "world"); // See the definition of Sequenceable.
caller.call(method, msg)
.then(() => {
console.log('Caller call() called');
}).catch((e) => {
console.log('Caller call() catch error ' + e);
})
.catch((callErr) => {
console.log('Caller.call catch error, error.code: ' + JSON.stringify(callErr.code) +
' error.message: ' + JSON.stringify(callErr.message));
});
console.log('Caller GetCaller Get ' + caller);
}).catch((e) => {
console.log('Caller GetCaller error ' + e);
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
```
......@@ -415,10 +461,20 @@ Sends sequenceable data to the target ability and obtains the sequenceable data
| -------- | -------- |
| Promise&lt;rpc.MessageParcel&gt; | Promise used to return the sequenceable data from the target ability.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. |
| 401 | Invalid input parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
**Example**
```js
import Ability from '@ohos.application.Ability';
```ts
import Ability from '@ohos.app.ability.UIAbility';
class MyMessageAble{
name:""
str:""
......@@ -456,12 +512,14 @@ Sends sequenceable data to the target ability and obtains the sequenceable data
console.log('Caller callWithResult() called');
let retmsg = new MyMessageAble(0, "");
data.readSequenceable(retmsg);
}).catch((e) => {
console.log('Caller callWithResult() catch error ' + e);
})
.catch((callErr) => {
console.log('Caller.callWithResult catch error, error.code: ' + JSON.stringify(callErr.code) +
' error.message: ' + JSON.stringify(callErr.message));
});
console.log('Caller GetCaller Get ' + caller);
}).catch((e) => {
console.log('Caller GetCaller error ' + e);
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
......@@ -476,10 +534,19 @@ Releases the caller interface of the target ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
**Example**
```js
import Ability from '@ohos.application.Ability';
```ts
import Ability from '@ohos.app.ability.UIAbility';
var caller;
export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
......@@ -491,21 +558,22 @@ Releases the caller interface of the target ability.
caller = obj;
try {
caller.release();
} catch (e) {
console.log('Caller Release error ' + e);
} catch (releaseErr) {
console.log('Caller.release catch error, error.code: ' + JSON.stringify(releaseErr.code) +
' error.message: ' + JSON.stringify(releaseErr.message));
}
console.log('Caller GetCaller Get ' + caller);
}).catch((e) => {
console.log('Caller GetCaller error ' + e);
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
```
## Caller.onRelease
## Caller.on
onRelease(callback: OnReleaseCallBack): void;
on(type: "release", callback: OnReleaseCallback): void;
Registers a callback that is invoked when the stub on the target ability is disconnected.
......@@ -515,12 +583,21 @@ Registers a callback that is invoked when the stub on the target ability is disc
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is fixed at **release**.|
| callback | OnReleaseCallBack | Yes| Callback used for the **onRelease** API.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example**
```js
import Ability from '@ohos.application.Ability';
```ts
import Ability from '@ohos.app.ability.UIAbility';
var caller;
export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
......@@ -531,15 +608,16 @@ Registers a callback that is invoked when the stub on the target ability is disc
}).then((obj) => {
caller = obj;
try {
caller.onRelease((str) => {
caller.on("release", (str) => {
console.log(' Caller OnRelease CallBack is called ' + str);
});
} catch (e) {
console.log('Caller Release error ' + e);
} catch (error) {
console.log('Caller.on catch error, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
}
console.log('Caller GetCaller Get ' + caller);
}).catch((e) => {
console.log('Caller GetCaller error ' + e);
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
......@@ -550,7 +628,6 @@ Registers a callback that is invoked when the stub on the target ability is disc
Implements callbacks for caller notification registration and deregistration.
## Callee.on
on(method: string, callback: CalleeCallBack): void;
......@@ -566,10 +643,18 @@ Registers a caller notification callback, which is invoked when the target abili
| method | string | Yes| Notification message string negotiated between the two abilities.|
| callback | CalleeCallBack | Yes| JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 16200004 | Method registered. The method has registered. |
| 16000050 | Internal Error. |
**Example**
```js
import Ability from '@ohos.application.Ability';
```ts
import Ability from '@ohos.app.ability.UIAbility';
class MyMessageAble{
name:""
str:""
......@@ -601,12 +686,16 @@ Registers a caller notification callback, which is invoked when the target abili
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log('Callee onCreate is called');
try {
this.callee.on(method, funcCallBack);
} catch (error) {
console.log('Callee.on catch error, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
}
}
}
```
## Callee.off
off(method: string): void;
......@@ -621,20 +710,34 @@ Deregisters a caller notification callback, which is invoked when the target abi
| -------- | -------- | -------- | -------- |
| method | string | Yes| Registered notification message string.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 16200005 | Method not registered. The method has not registered. |
| 16000050 | Internal Error. |
**Example**
```js
import Ability from '@ohos.application.Ability';
```ts
import Ability from '@ohos.app.ability.UIAbility';
var method = 'call_Function';
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log('Callee onCreate is called');
try {
this.callee.off(method);
} catch (error) {
console.log('Callee.off catch error, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
}
}
}
```
## OnReleaseCallBack
## OnReleaseCallback
(msg: string): void;
......@@ -644,7 +747,7 @@ Deregisters a caller notification callback, which is invoked when the target abi
| -------- | -------- | -------- | -------- | -------- |
| (msg: string) | function | Yes| No| Prototype of the listener function registered by the caller.|
## CalleeCallBack
## CalleeCallback
(indata: rpc.MessageParcel): rpc.Sequenceable;
......@@ -653,3 +756,5 @@ Deregisters a caller notification callback, which is invoked when the target abi
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes| No| Prototype of the listener function registered by the callee.|
<!--no_check-->
\ No newline at end of file
......@@ -17,7 +17,7 @@ This module provides APIs for accessing resources of a specific Extension abilit
| -------- | -------- | -------- | -------- | -------- |
| currentHapModuleInfo | HapModuleInfo | Yes| No| Information about the HAP file<br>(See **api\bundle\hapModuleInfo.d.ts** in the **SDK** directory.) |
| config | Configuration | Yes| No| Module configuration information.<br>(See **api\@ohos.application.Configuration.d.ts** in the **SDK** directory.)|
| extensionAbilityInfo | [ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md) | Yes| No| Extension ability information.<br>(See **api\bundle\extensionAbilityInfo.d.ts** in the **SDK** directory.)|
| extensionAbilityInfo | [ExtensionAbilityInfo](js-apis-bundleManager-extensionAbilityInfo.md) | Yes| No| Extension ability information.<br>(See **api\bundle\extensionAbilityInfo.d.ts** in the **SDK** directory.)|
## When to Use
**ExtensionContext** provides information about an Extension ability, module, and HAP file. You can use the information based on service requirements. The following uses **ServiceExtension** as an example to describe a use case of **ExtensionContext**.
......@@ -31,7 +31,7 @@ To adapt to devices with different performance, an application provides three mo
Define a **ServiceExtension** with the same name for the three modules.
``` js
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import ServiceExtension from '@ohos.app.ability.ServiceExtensionAbility'
import Want from '@ohos.application.Want'
export default class TheServiceExtension extends ServiceExtension {
onCreate(want:Want) {
......@@ -61,7 +61,7 @@ export default class TheServiceExtension extends ServiceExtension {
Start **ServiceExtension** within the **onCreate** callback of the main ability of the entry.
``` js
import Ability from '@ohos.application.Ability'
import Ability from '@ohos.app.ability.Ability'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册