title: Error "None of the following functions can be called with the arguments supplied:" with Toast
body: <p>I want to create a code to click on items of RecyclerView. I found one from Internet, however it keep getting this error:</p>
  <blockquote>
  <p>None of the following functions can be called with the arguments supplied:</p>
  <p>public open fun makeText(p0: Context!, p1: CharSequence!, p2: Int): Toast! defined in android.widget.Toast</p>
  <p>public open fun makeText(p0: Context!, p1: Int, p2: Int): Toast! defined in android.widget.Toast</p>
  </blockquote>
  <p>Here's my code:</p>
  <pre><code>override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          recyclerView.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)
          val users = ArrayList&lt;User&gt;()
  
          val adapter = CustomAdapter(users)
  
          recyclerView.adapter = adapter
  
          recyclerView.addOnItemClickListener(object : OnItemClickListener {
              override fun onItemClicked(position: Int, view: View) {
                  Toast.makeText(this, &quot;Clicked on  &quot; + users.get(position).name, Toast.LENGTH_LONG).show()
              }
          })
  
  
      }
  
      interface OnItemClickListener {
          fun onItemClicked(position: Int, view: View)
      }
  
      fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) {
          this.addOnChildAttachStateChangeListener(object : RecyclerView.OnChildAttachStateChangeListener {
              override fun onChildViewDetachedFromWindow(view: View) {
                  view.setOnClickListener(null)
              }
  
              override fun onChildViewAttachedToWindow(view: View) {
                  view.setOnClickListener {
                      val holder = getChildViewHolder(view)
                      onClickListener.onItemClicked(holder.adapterPosition, view)
                  }
              }
          })
      }
  </code></pre>
  <p>How can I fix that error message?</p>