title: Convert Function Call to Lambda (SAM)
body: <p>In an android program, I have the following code:</p>
  
  <pre><code>clockCheckBox.setOnClickListener((object: View.OnClickListener {
      override fun onClick(view: View): Unit {
          if (clockCheckBox.isChecked())
              enableClocks()
          else
              disableClocks()
      }
  }))
  </code></pre>
  
  <p>In Android Studio, a tooltip comes up that says, </p>
  
  <blockquote>
    <p>This inspection reports an anonymous object literal implementing a
    java interface with single abstract method that can be converted into
    call with lambda expression.</p>
  </blockquote>
  
  <p>I have tried to do this, but all I get is syntax errors.  Can you show me the correct syntax?  I should perhaps explain that this code is in the <code>onCreate</code> method of my activity and clockCheckBox is a local variable defined as</p>
  
  <pre><code>val clockCheckBox = findViewById(R.id.clockCheckBox) as CheckBox
  </code></pre>