Challenge 2: Pass Data to the Second Activity — Solution // MainActivity.kt — inside onCreate, after binding is set up binding.goToDetailButton.setOnClickListener { val message = binding.messageInput.text.toString() val intent = Intent(this, DetailActivity::class.java) intent.putExtra("MESSAGE", message) startActivity(intent) } // DetailActivity.kt class DetailActivity : AppCompatActivity() { private lateinit var binding: ActivityDetailBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityDetailBinding.inflate(layoutInflater) setContentView(binding.root) val message = intent.getStringExtra("MESSAGE") ?: "No message received" binding.detailText.text = message } } Notes: - binding.messageInput.text.toString() reads the EditText's current content at the moment the button is clicked, not continuously — a fresh read each click. - intent.getStringExtra("MESSAGE") returns String? (nullable) since the key might not exist at all — the ?: "No message received" Elvis fallback (Kotlin Fundamentals Chapter 3) handles that case cleanly, covering both "DetailActivity launched with no extra" and "the key genuinely wasn't set" scenarios. - Using a shared constant (e.g. const val EXTRA_MESSAGE = "MESSAGE", referenced from both Activities) instead of the raw string literal "MESSAGE" in both places would remove the risk of a typo mismatch between sender and receiver — worth doing in real code, simplified here for clarity.