How to navigate from a Composable to an Activity in Jetpack Compose?

What are the ways in which navigation is possible between a composable and an Activity and vice versa? Can I do it by using the startActivity(...) method or is the only way to create Screens and NavController?

Android Studio Screenshot


  • In newer version of compose use LocalContext.
    In older versions (1.0.0-alpha08 and before) use AmbientContext:

    fun MainScreen() {
        val context = LocalContext.current
        Button(onClick = {
        }) {
            Text(text = "Show List")