Challenge 2: Click Handling — Solution class ProductAdapter( private val products: List, private val onProductClick: (Product) -> Unit ) : RecyclerView.Adapter() { class ProductViewHolder(val binding: ItemProductBinding) : RecyclerView.ViewHolder(binding.root) override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ProductViewHolder { val binding = ItemProductBinding.inflate( LayoutInflater.from(parent.context), parent, false ) return ProductViewHolder(binding) } override fun onBindViewHolder(holder: ProductViewHolder, position: Int) { val product = products[position] holder.binding.nameText.text = product.name holder.binding.priceText.text = "$${product.price}" holder.binding.root.setOnClickListener { onProductClick(product) } } override fun getItemCount() = products.size } // MainActivity.kt — inside onCreate binding.recyclerView.layoutManager = LinearLayoutManager(this) binding.recyclerView.adapter = ProductAdapter(products) { clickedProduct -> Log.d("MainActivity", "Clicked: ${clickedProduct.name}") } Notes: - onProductClick is stored as a constructor property, so every ViewHolder's click listener (set inside onBindViewHolder) can call it with that specific row's product. - holder.binding.root refers to the entire item layout's root View — making the whole row clickable, not just one piece of text inside it. - Because "product" is captured inside the lambda passed to setOnClickListener, clicking any row correctly reports THAT row's product, even though the same click-listener-setting code runs identically for every row.