• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.app.ability.ChildProcess
2
3**ChildProcess** is the base class for you to customize child processes. When starting a child process through [childProcessManager](js-apis-app-ability-childProcessManager.md), you must inherit this class and override the entrypoint method.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 11. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8>
9> The APIs of this module can be used only in the stage model.
10
11## Modules to Import
12
13```ts
14import ChildProcess from '@ohos.app.ability.ChildProcess';
15```
16
17## ChildProcess.onStart
18
19onStart(): void;
20
21Entrypoint method of the child process. This callback is triggered when the child process is started through [childProcessManager](js-apis-app-ability-childProcessManager.md).
22
23**System capability**: SystemCapability.Ability.AbilityRuntime.Core
24
25**Example**
26```ts
27import ChildProcess from '@ohos.app.ability.ChildProcess';
28
29export default class DemoProcess extends ChildProcess {
30  onStart() {
31    console.log("DemoProcess OnStart() called");
32  }
33}
34```
35