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
Post a Comment