目录

What is the level of the context obtained by calling the createModuleContext API in the HAP?

  1. The createModuleContext API obtains a base class context, which is used to obtain a context based on different module names, each pointing to a different HSP.
  2. An HSP is merely a dynamic shared package that contains static resources, but it does not have the concept of context itself. Therefore, a context must be created to access these resources or module information.
  3. The createModuleContext API obtains a module-level context, not an application context.

Reference

Context (Stage Model)