Criminal Intent gives syntax error in listing 9.15

private inner class CrimeHolder(view: View)
    : RecyclerView.ViewHolder(view), View.OnClickListener {
    private lateinit var crime: Crime
    private val titleTextView: TextView = itemView.findViewById(R.id.crime_title)
    private val dateTextView: TextView = itemView.findViewById(R.id.crime_date)

    init {
        itemView.setOnClickListener(this)
    }

    fun bind(crime: Crime) {
        this.crime = crime
        titleTextView.text = this.crime.title
        dateTextView.text = this.crime.date.toString()
    }
    
    override fun onClick(v: View) {
        Toast.makeText(context, "${crime.title} pressed!", Toast.LENGTH_SHORT)
        .show()
    }
}

The error is :

  1. Class ‘CrimeHolder’ is not abstract and does not implement abstract member public abstract fun onClick(v: View!): Unit defined in android.view.View.OnClickListener

  2. ‘onCLick’ overrides nothing