For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/lynx-native-api/lynx-view/add-lynx-view-client.md.
Lynx
  • English
  • addLynxViewClient

    Register lifecycle event observer for LynxView.

    Syntax

    Android

    public void addLynxViewClient(LynxViewClient client);

    Parameters

    • client: The structure implemented by the client and registered to the LynxView instance is used to obtain the callbacks of each process in the LynxView lifecycle

    iOS

    - (void)addLifecycleClient:(nonnull id<LynxViewBaseLifecycle>)lifecycleClient;

    Parameters

    • lifecycleClient: The structure implemented by the client and registered to the LynxView instance is used to obtain the callbacks of each process in the LynxView lifecycle.

    Harmony

    Field

    LynxView has clients member:

    • clients: LynxViewClient[]: The structure implemented by the client and registered to the LynxView instance is used to obtain the callbacks of each process in the LynxView lifecycle.

    On the HarmonyOS platfrom, you need to pass your implemented LynxViewClient as a parameter during the initialization of LynxView:

    @Entry
    @Component
    struct Index {
      private clients: EntryLynxClient[] = [new EntryLynxClient()];
    
      build() {
        Column() {
          LynxView({
            clients: this.clients,
          }).width('100%').height('100%');
        }
        .size({ width: '100%', height: '100%' })
      }
    }

    Desktop (C++)

    void AddClient(std::shared_ptr<lynx::pub::LynxViewClient> client);

    Parameters

    • client: The lifecycle observer registered to the LynxView instance. The same client instance is retained by LynxView until it is removed.

    Compatibility

    LCD tables only load in the browser

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.