title: Cannot find R.layout.activity_main
body: <p>I was trying to work out with multiple layout using some online tutorials. The thing is my program was building and compiling correctly as long as there was only one XML file. When I added multiple XML files, I am getting errors saying 'activity_main cannot be resolved or is not a field' for the line <code>setContentView(R.layout.activity_main);</code></p>
  
  <p>In fact, every item which I used previously in <code>R.*</code> is now reporting error. I don't know what went wrong. Can anyone suggest what needs to be done?</p>
  
  <p>Edit 1: I tried cleaning and rebuilding the project but that didn't help. Plus, I am importing the correct <code>R.java</code> file as in <em>mypackage</em>.R.java</p>
  
  <p>According to @RubberDuck's comment, I as soon as I deleted the files again, the R.java file was being generated after building the project. However, when I create new XML files and add elements in it, build the project, R.java gets deleted.</p>