I am trying to show a Compose Dialog on Button cli...
# compose
j
I am trying to show a Compose Dialog on Button click in a Fragment which uses XML resource as a View. When I call openDialog(…) I get the following exception java.lang.IllegalStateException: Composition requires an active composition context. Is it even possible to mix XML and Compsoe together or was it not implemented yet? Thanks! 🙂
l
It’s not implemented yet
A
@Composable
function need to be called inside the
setContent
function
👍 3
You can’t call a composable wherever you want
j
Ok, thanks 🙂
r
If you're willing to put up with some awkwardness, there's a
ViewGroup.setContent
extension function, though, that would allow you to do that