Hello World, most basic of setup errors
All i am trying to do is setup a simple android "hello world" example, i
have made no alteration to the java code or xml layout (none to xml at all
in fact) beyond what has been prescribed through searching stackoverflow
as a remedy to the problems i am experiencing: scr folder errors, "R
cannot be resolved to a variable."
I have followed the advice to import mypackage.R rather than android.R and
to clean the project, as well as to rebuild it, restart eclipse after
clean, and everything related that i can find... when i follow the advice
to clean the project eclipse erases "import local.example.Project1.R" and
resets it to "android.R" or completely removes the import...
i'm throwing errors in the simplest example of "hello world," which should
be good to go right out of the box and cannot find a resonable explanation
as to why...
what am i missing?
if it helps anyone to figure out the problem i notice that the gen folder
does not contain anything, though indications are that it should contain a
autogenerated java file....
package local.example.Project1;
import local.example.Project1.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;
}
}
No comments:
Post a Comment