Android Studio Activity Java File does not recognize XML

Viewed 795

I have a big problem. Last I copied a CardView with RecyclerView from a video. After that I created a new empty activity, but the Javafile didn't want to accept the corresponding XML file. And if I go with ALT + ENTER he suggests to me to create your xml file, but afterwards he tells me it already exists. So I can open the XML file, the program recognizes it but it is not recognized in the Java data and I cannot select it there either. There a screen shot, There a picture from solution research, And There a photo of the xml File. Can someone help me there? Thank you in advance!

3 Answers

I was facing the same problem but you just need to close your project and open it again, the error related to activity file will bee removed!!Just try it.....

maybe you need to rebuild your app

1- Build > clean project

2 - Build > Rebuild project

I hope it will work with you .

Delete those two files. Copy the code first. Go to File ->new activity then create that activity and paste the code there, besides those lines.

Related