0Pricing
Jetpack Compose Academy · Lesson

setContent: Where Your UI Begins

Hook your Composable tree into the Activity.

Connecting Compose to Android

Your Composables need a home. The setContent call inside an Activity is the bridge that hands your UI tree to the Android screen. 🔗

Inside onCreate

You call setContent from an Activity onCreate. That is the moment Android tells your app it is time to show a screen.

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContent { Greeting() }
}

All lessons in this course

  1. Writing a @Composable Function
  2. Live Previews with @Preview
  3. Calling Composables from Composables
  4. setContent: Where Your UI Begins
← Back to Jetpack Compose Academy