Error: onActivityResult overrides nothing : <p>I am programming a speech recognition app in Kotlin for Android. </p>

<pre><code>class MainActivity : AppCompatActivity() {
    public override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val intent:Intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
            intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
        startActivityForResult(intent, REQUEST_CODE)

    }

    override fun onActivityResult(requestCode:Int, resultCode:Int, data:Intent) {
        if (requestCode == REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {/*do something*/  }
        super.onActivityResult(requestCode, resultCode, data)
    }
}
</code></pre>

<p>Strangly the compiler  always finds the Error: 'onActivityResult' overrides nothing. </p>

<p>Documentation of Android states that result of startActivityForResult can be retrived with onActivityResult.</p>

<p>Now the question: how can one get the result of  speech recognition using Kotlin?</p>
