0Pricing
Android Academy · Lesson

Intents & Navigation

Navigate between Activities with explicit Intents, pass data with putExtra/getExtra, and launch external apps with implicit Intents.

What Is an Intent?

An Intent is a message that tells Android to do something:

  • Explicit Intent — launch a specific Activity in your app
  • Implicit Intent — ask Android to find an app that can handle the action (open a URL, call a number, share text)

Intents are the primary way Activities communicate with each other.

Explicit Intent: Open a Screen

Launch another Activity in your app:

// In your button click listener:
binding.btnGoToDetail.setOnClickListener {
    val intent = Intent(this, DetailActivity::class.java)
    startActivity(intent)
}

// To also close the current screen after navigating:
binding.btnLogin.setOnClickListener {
    val intent = Intent(this, HomeActivity::class.java)
    startActivity(intent)
    finish() // removes LoginActivity from back stack
}

All lessons in this course

  1. Project Structure & Manifest
  2. Activities & Lifecycle
  3. Layouts & Views
  4. Handling User Input
  5. Intents & Navigation
  6. Fragments
  7. Permissions & Runtime Requests
← Back to Android Academy