Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arriolac/ffa8bf6dd4a2b4c8f2bcc4c82cbe2fb4 to your computer and use it in GitHub Desktop.
Save arriolac/ffa8bf6dd4a2b4c8f2bcc4c82cbe2fb4 to your computer and use it in GitHub Desktop.
How to change the ViewCompositionStrategy of a ComposeView
// Copyright 2023 Google LLC.
// SPDX-License-Identifier: Apache-2.0
// Change ViewCompositionStrategy to DisposeOnViewTreeLifecycleDestroyed
val composeView = ComposeView(context = context)
composeView.setViewCompositionStrategy(
ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment