capture To Image
Should be called from the main thread. You can use Activity.runOnUiThread if you are on another thread. For Kotlin coroutines, use the below code if your coroutine is on another thread:
val image = withContext(Dispatchers.Main) {
captureToImage(myActivity/*OR this*/, composable)
}Content copied to clipboard