I have a Jetpack Compose project were I can access a coroutineContext
object only. No context
available here.
How can I access or initialize android.content.pm.PackageManager ?
You can get the context object from ContextAmbient.current
, using that you can get the PackageManager
Example:
val context = ContextAmbient.current
val packageManager = context.packageManager