0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

suddenly Risn't recognized, probably something I have done.

Can someone explain to me what does it mean the R.layout...? And what can I do to fix it?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Omer
  • 307
  • 5
  • 17

5 Answers5

3

Sometime if your xml file have some error, the studio will not auto generate the R.java

yong.k
  • 678
  • 1
  • 8
  • 22
1

Might be the problem because of some changes in layout..

Build-> Clean Project and then you will get build fail because of some error, then solve that error you will get appropriate result.

Vijay
  • 156
  • 1
  • 14
1

Restart the android studio. If doesn't work then it might be problem with theme.

Ankur_009
  • 3,823
  • 4
  • 31
  • 47
1

First Rebuild your Gradle by doing this Build -> Rebuild Projects if that doesn't work. In your Project bar(left side of your screen), goto Gradle Scripts and double click on build.gradle file, inside that file check your dependencies if your have something similar to this compile 'com.android.support:appcompat-v7:24.2.1' there, if you don't have it just copy and paste this there and then rebuild your project.

devmike01
  • 1,971
  • 1
  • 20
  • 30
1

Maybe this may help,

Go to your manifest file, change the package name, and make a Project Clean.

Rissmon Suresh
  • 13,173
  • 5
  • 29
  • 38