目录

How do I add pages into a window functioning as a toast in a HAR?

Symptom

A window in a HAR is used to display a toast, whose content is implemented through a page. However, when window.setUIContent is called to load the page, an import failure occurs.

Solution

  1. HARs do not support pages. It is recommended that you declare the window in the HAP to place the HAR or HSP components.
  2. To implement a toast, you can use the ArkTS components for creating a custom dialog box UI.

Reference

Custom Dialog Box (CustomDialog)