I'm following the android tutorial and can't get hello world to work. I have the same problem as described in this this SO question and I tried to use this SO answer as a remedy. However it didn't work.
I still get activity_main cannot be resolved
(line 12) and main cannot be resolved
(line 19).
I simply started a new android project and my MainActivity.java
looks like this (note that I use android.R. ...
:
package com.arandomtesteinstein.testandroid;
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(android.R.layout.activity_main); /* <----- Error in line 12 */
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(android.R.menu.main, menu); /* <----- Error in line 19 */
return true;
}
}
What am I doing wrong?
EDIT:
OK, just to clarify, I'm following exactly (to my best knowledge) the official android tutorial. When I get to the point where I click 'run' eclipse throws the error mentioned above. I then found this SO answer (second link above) and tried to follow it, however it still didn't work. Strictly speaking, I am not developing or doing anything smart or dump, I'm just trying to follow the very initial steps of the tutorial