Bryan Lee
12/17/2019, 11:08 PMval context = +ambient(ContextAmbient)
from a composable nested within setViewContent{ }?
Currently seem to be getting an NPE because of this.
Is there an alternative way of getting context?
EDIT: Currently I'm doing this from my activity to get context to a listener into my composable function.
val context: Context = this
setViewContent {
MapApp(context = context)
}
Leland Richardson [G]
12/17/2019, 11:53 PMfun Activity.mySetViewContent(content: @Composable () -> Unit) = setViewContent { ContextAmbient.Provider(this, content) }
setViewContent
utility functionBryan Lee
12/17/2019, 11:58 PM