onStateChanged

open override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event)

Handles Android lifecycle events from the host LifecycleOwner.

  • ON_PAUSE / ON_RESUME pause and resume the underlying WebView.

  • ON_DESTROY calls destroy, which also removes this observer from the lifecycle.