i am new to android app development,
i have just created simple android project, but when it created it shows error.
"R cannot be resolved to a variable" when i press control shift +o
android.R is automatically added to my code but now it shows this error
"activity_main cannot be resolved or is not a field"
this is code of this project
package com.php.helloworld;
import android.R;
import android.app.Activity;
import android.os.Bundle;
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;
}
}
and when i tried to write this line
import com.php.helloworld.R it shows "The import com.php.helloworld.R cannot be resolved"
There is also no problem in my xml file and and there is no file in gen folder can somebody help me please to resolve this