android - Error with layout on new application project -


i create new application project on eclipse, gives immediatly errors on code of mainactivity.class. error on r. of setcontentview

@override  protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main); }  @override public boolean oncreateoptionsmenu(menu menu) {     // inflate menu; adds items action bar if present.     getmenuinflater().inflate(r.menu.main, menu);     return true; } 

but if import android.r, gives error on words activity_main (it doesn't recognize layout), , on word main. can do? it's strange error on applications created.

make sure have layout activity_main.xml within res/layout directory , menu main.xml within res/menu directory.

you shouldn't import android.r


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -