https://kotlinlang.org logo
#compose
Title
# compose
p

Priyank

06/29/2022, 9:32 AM
I am using compose maps library to display clusters of markers. Now to display a custom info window adapter I want to use the compose. I have followed the documentation of interoperability of compose via ComposeView. but when I add the ComposeView inside the info window method I am getting this error of cannot locate window recomposer.
Cannot locate windowRecomposer; View androidx.compose.ui.platform.ComposeView{e560fcf V.E...... ......I. 0,0-0,0} is not attached to a window
Copy code
clusterManager?.markerCollection?.setInfoWindowAdapter(object : InfoWindowAdapter {
    override fun getInfoContents(p0: Marker): View? {
        return null
    }

    override fun getInfoWindow(p0: Marker): View {
        val composeView = ComposeView(context).apply {
            setContent {
                Text("Hello World")
            }
        }
        return composeView
    }
})
So is there any way to use the compose function inside getInfoWindow()?
6 Views