após atualizar o gradle inteiro tentei rodar o programa e apareceram esses erros:
e: C:\Users\Ley\Desktop\android-tech-news-projeto-inicial\app\src\main\java\br\com\alura\technews\ui\activity\FormularioNoticiaActivity.kt: (56, 5): 'onOptionsItemSelected' overrides nothing
e
e: C:\Users\Ley\Desktop\android-tech-news-projeto-inicial\app\src\main\java\br\com\alura\technews\ui\activity\FormularioNoticiaActivity.kt: (64, 44): Type mismatch: inferred type is MenuItem? but MenuItem was expected
linha 56:
56>> override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
R.id.formulario_noticia_salva -> {
val titulo = activity_formulario_noticia_titulo.text.toString()
val texto = activity_formulario_noticia_texto.text.toString()
salva(Noticia(noticiaId, titulo, texto))
}
}
64>> return super.onOptionsItemSelected(item***)
}