i need the fragment context for some legacy dialogs inside a composable.
Copy code
LocalContext.current
is not returning me the fragment context. Is there a way to get it, without passing the context explicitly?
myanmarking
01/21/2022, 4:03 PM
i think i got it. I was passing wrong context in ComposeView
c
Casey Brooks
01/21/2022, 4:10 PM
Fragments don't extend
Context
like an
Activity
does, so
LocalContext
will never give you a reference to a Fragment.
m
myanmarking
01/21/2022, 4:12 PM
ya. but i’m using a themed context (contextThemeWrapper) in the composeView because i need different context based on the fragment. For some reason, its not using that context