0

So I created a new activity called "Menu", but it gives the following error in the menu.kt file, and yes, I have an activity_menu file created. See following image: enter image description here

What should I do? Thank you in advance

Full code:

package com.example.native_productivityapp

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View


class Menu : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_menu)
    }
}

SOLVED: JUST NEEDED TO RESTART AND REBUILD

Prensapjaimo
  • 67
  • 1
  • 1
  • 6

2 Answers2

1

Environmental problems,restart Android Studio

Win Lee
  • 28
  • 4
1

have you tried to clean the project: Build -> Clean Project, or try to invalidate the cache and restart (File -> Invalidate Cache and Restart)

Raluca
  • 41
  • 5