I created a small practice app which changes the image on-screen when the buttonNext is clicked. However, neither the image nor button does anything. Everything in my MainActivity looks normal for an onClickListener setup and I followed various guides to create a layout which works. But, I'm not sure why it looks so weird and does not work in the emulator.

Here is the MainActivity code I wrote so far:

```
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    setListener()
}

private fun changeImage(view: View) {
    when (view.id) {
        R.id.goodMorning -> view.setBackgroundResource(R.drawable.gm1)
        R.id.goodMorning -> view.setBackgroundResource(R.drawable.gm2)

        else -> view.setBackgroundColor(Color.LTGRAY)
    }
}

private fun setListener() {
    val goodMorning = findViewById<ImageView>(R.id.goodMorning)
    val buttonNext = findViewById<TextView>(R.id.buttonNext)

    fun setListener(){

        val clickableViews: List<View> =
            listOf(goodMorning, buttonNext)

        for (item in clickableViews){
            item.setOnClickListener() { changeImage(it) }
        }
    }
}

```

}

This is the layout xml:

```
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<ImageView
    android:id="@+id/goodMorning"
    android:layout_width="404dp"
    android:layout_height="562dp"
    android:contentDescription="@android:string/no"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.428"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.365"
    tools:srcCompat="@drawable/gm1" />

<Button
    android:id="@+id/buttonNext"
    style="@style/twoButtons"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginLeft="16dp"
    android:layout_marginEnd="16dp"
    android:layout_marginRight="16dp"
    android:text="@string/buttonNext"
    android:textSize="@dimen/box_text_size"
    app:layout_constraintBaseline_toBaselineOf="@+id/buttonBack"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toEndOf="@+id/buttonBack" />

<Button
    android:id="@+id/buttonDownload"
    style="@style/twoButtons"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginLeft="16dp"
    android:layout_marginEnd="16dp"
    android:layout_marginRight="16dp"
    android:text="@string/buttonDownload"
    android:textSize="@dimen/box_text_size"
    app:layout_constraintBaseline_toBaselineOf="@+id/buttonBack"
    app:layout_constraintEnd_toStartOf="@+id/buttonBack"
    app:layout_constraintStart_toStartOf="parent" />

<Button
    android:id="@+id/buttonBack"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="16dp"
    android:layout_marginBottom="16dp"
    android:text="@string/buttonBack"
    android:textColor="@android:color/black"
    android:textSize="@dimen/box_text_size"
    android:textStyle="bold"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.498"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/goodMorning"
    app:layout_constraintVertical_bias="0.718" />

```

This is what the app looks like in Pixel 2:
[![enter image description here](https://i.stack.imgur.com/7OJQa.jpg)](https://i.stack.imgur.com/7OJQa.jpg)

Any help is greatly appreciated!