AndroidUiContext
A CoroutineContext.Element for binding an Android activity Context to a coroutine.
In Compose, use org.multipaz.compose.rememberUiBoundCoroutineScope to automatically include an AndroidUiContext in the coroutine scope. When not using Compose, pass AndroidUiContext(activity) to launch or withContext:
withContext(AndroidUiContext(activity)) {
...
}Content copied to clipboard
Parameters
context
the Context being held; must be an android.app.Activity or wrap one via android.content.ContextWrapper.