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%' })
  }
}

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.