harmony 鸿蒙@ohos.app.ability.ChildProcess

  • 2023-10-30
  • 浏览 (382)

@ohos.app.ability.ChildProcess

ChildProcess is the base class for you to customize child processes. When starting a child process through childProcessManager, you must inherit this class and override the entrypoint method.

NOTE

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.

The APIs of this module can be used only in the stage model.

Modules to Import

import ChildProcess from '@ohos.app.ability.ChildProcess';

ChildProcess.onStart

onStart(): void;

Entrypoint method of the child process. This callback is triggered when the child process is started through childProcessManager.

System capability: SystemCapability.Ability.AbilityRuntime.Core

Example

import ChildProcess from '@ohos.app.ability.ChildProcess';

export default class DemoProcess extends ChildProcess {
  onStart() {
    console.log("DemoProcess OnStart() called");
  }
}

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

0  赞