error on lines:
setContentView(R.layout.activity_main);
getMenuInflater().inflate(R.menu.activity_main, menu);

error: ----- R cannot be resolved to a variable




package com.example.android_01;




import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.EditText;


public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}




@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}


note i also tried importing:

import com.example.android_01.R;

but didnt worked.





i than try adding:

import android.R;

but than i got another error:" activity_main cannot be resolved or is not a field" on line:

setContentView(R.layout.activity_main);