Skip to content
🤔 Documentation issue? Report or edit

How to get Android Context

You can use LocalContext.current to receive the context of your Android App inside a Compose Function

@Composable
fun AndroidContextComposeDemo() {
    val context = LocalContext.current
    Text(text = "Read this string from Context: "+context.getString(R.string.app_name))
}

See also:


Last update: May 17, 2022