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(
    private val dateTextView: TextView = itemView.findViewById(

    init {

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

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