I created a android app with eclipse but when I try to execute I've this problem.
package com.example.myfirstapp;
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.main, menu);
return true;
}
}
In the instruction where I use "R" like : setContentView(R.layout.activity_main);
builder tell me an error and exactly "R cannot be resolved to a variable"
I've read something about this but I haven't found my solution.
It's like R is android.R
and not my layout folder. I don't know what to do! I need a little hint. This is really my first android App.