title: OnClickListener for multiple buttons does not work
body: <p>I searched here fo a solution and on google but it doesn't work for me and I can't understand why.
  I did everything like in this solution: <a href="https://myandroid.site/multiple-onclicklistener-in-kotlin-android-studio-example/" rel="nofollow noreferrer">Multiple OnClickListener in Kotlin</a></p>
  <p>XML Code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;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"&gt;
  
      &lt;Button
          android:id="@+id/btnP1"
          android:layout_width="60dp"
          android:layout_height="54dp"
          android:layout_marginTop="200dp"
          android:fontFamily="sans-serif-medium"
          android:shape="rectangle"
          android:text="1"
          android:textColor="#000000"
          android:textSize="18sp"
          android:textStyle="bold"
          app:backgroundTint="#98BFD1"
          app:layout_constraintEnd_toStartOf="@+id/btnP2"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/txtDart1"
          tools:text="1" /&gt;
  
      &lt;Button
          android:id="@+id/btnP2"
          android:layout_width="60dp"
          android:layout_height="54dp"
          android:layout_marginTop="334dp"
          android:shape="rectangle"
          android:text="2"
          android:textColor="#000000"
          android:textSize="18sp"
          android:textStyle="bold"
          app:backgroundTint="#98BFD1"
          app:layout_constraintEnd_toStartOf="@+id/btnP3"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toEndOf="@+id/btnP1"
          app:layout_constraintTop_toTopOf="parent"
          tools:text="2" /&gt;
          
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>MainActivity.kt:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package com.example.test
  
  import android.os.Bundle
  import android.view.View
  import android.widget.Toast
  import androidx.appcompat.app.AppCompatActivity
  
  class MainActivity : AppCompatActivity(), View.OnClickListener {
  
      private var toast: Toast? = null
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          btnP1.setOnClickListener(this)
          btnP2.setOnClickListener(this)
  
      }
  
      override fun onClick(view: View?)
      {
          when ( view!!.id)
          {
              TODO()
          }
  
      }
  
      private fun myToast(string: String)
      {
          toast = Toast.makeText(this,string,Toast.LENGTH_SHORT)
          toast?.show()
      }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Problem:  <code>btnP1.setOnClickListener(this)</code> and <code>btnP2.setOnClickListener(this)</code></p>
  <p>-&gt; btnP1 and btnP2 are always red -&gt; &quot;unresolved reference&quot;</p>
  <p>Why does it work for everyone but not in my case?</p>
  <p>Thank you!</p>