Just after creating the new Android Application Project I get the error "R cannot be resolved to a variable" in my MainActivity.java file.
This is it's content:
package com.example.firstapp;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
Why am I getting this problem if the app was created by Eclipse choosing all the default options? How can I fix this issue?