The default project of DevEco Studio does not contain AbilityStage. To use AbilityStage, you can manually create an AbilityStage file. The procedure is as follows:
import { AbilityStage, Want } from '@kit.AbilityKit';
export default class MyAbilityStage extends AbilityStage {
onCreate(): void {
// When the HAP of the application is first loaded, initialize the operation for the module
}
onAcceptWant(want: Want): string {
// Triggered only when UIAbility is configured in specified startup mode
return 'MyAbilityStage';
}
} {
"module": {
"name": "entry",
"type": "entry",
"srcEntry": "./ets/myabilitystage/MyAbilityStage.ets",
// ...
}
} An AbilityStage has the onCreate() and onDestroy() lifecycle callbacks, and the onAcceptWant(), onConfigurationUpdate(), and onMemoryLevel() event callbacks.