imageview kotlin

// 1. Find the ImageView in the layout file using its ID
val imageView = findViewById<ImageView>(R.id.imageView)

// 2. Load an image from a resource into the ImageView
imageView.setImageResource(R.drawable.my_image)

// 3. Set a click listener on the ImageView
imageView.setOnClickListener {
    // Perform actions when the ImageView is clicked
    // For example, show a toast message
    Toast.makeText(this@YourActivity, "Image Clicked!", Toast.LENGTH_SHORT).show()
}