The following methods are provided, with the most recommended ones listed first:
- Method 1: Call startAbility to start another UIAbility, with the startup parameters passed through wantInfo. You can also use startAbilityForResult to obtain the information returned when the called UIAbility is closed.
- Method 2: Use application-level state management AppStorage, PersistentStorage, and Environment to share state data of an application or multiple pages.
- Method 3: Use AppStorage or LocalStorage to pass data between UIAbility components in the same application.
- Method 4: Use Emitter and Worker for inter-thread communication.
- Method 5: Use the Common Event Service (CES) for inter-process communication.
- Other methods: Use Call for UIAbility interaction.
Reference
Starting UIAbility in the Same Application
Application State Management Overview
Data Synchronization Between UIAbility and UI Page
Thread Model
Introduction to Common Events