Created
May 4, 2023 20:50
-
-
Save arriolac/ffa8bf6dd4a2b4c8f2bcc4c82cbe2fb4 to your computer and use it in GitHub Desktop.
How to change the ViewCompositionStrategy of a ComposeView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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