renderInto

fun renderInto(container: ViewGroup, debug: Boolean = false, debugTag: String = "ViewCompose", overlayHost: OverlayHost = OverlayHostDefaults.noOp, onRenderStats: (RenderStats) -> Unit? = null, onRenderResult: (RenderTreeResult) -> Unit? = null, onRenderFailure: (RenderFailure) -> Unit? = null, content: UiTreeBuilder.() -> Unit): RenderSession(source)

Creates a retained session that renders content into container.

The Android render platform is installed on demand and the first frame is rendered synchronously before this function returns. This low-level entry does not provide lifecycle, ViewModel, saved state, environment, theme, or frame-clock locals; custom hosts must provide and dispose those services themselves, or use an Activity/Fragment setUiContent integration.

Return

the active session after its first synchronous frame

Parameters

container

Android parent that owns all Views mounted by the returned session

debug

enables render logging and full render-result collection

debugTag

log tag used by debug rendering

overlayHost

overlay implementation available to emitted overlay nodes

onRenderStats

optional callback after every attempted frame

onRenderResult

optional callback for collected diagnostics

onRenderFailure

optional callback when a frame fails

content

retained declarative content evaluated for each render

Samples

val session = renderInto(container) {
    Text("Custom host")
}

session.setRenderingActive(false)
session.render()
session.dispose()