android - Problems with R.layout.main -


i having hard time trying way around this. started new project, , without doing project shows error @ mainactivity.java src, right @ line...

setcontentview(r.layout.activity_main); 

gives me "r cannot resolve variable", ok, "quick fixes" gives me among others option import r, go ahead , it, got new error " activity_main cannot resolved or not field" , quick fixes gives me 1 option, "change activity_list_item", question is: why happening?

and on method

public boolean oncreateoptionsmenu(menu menu) {         // inflate menu; adds items action bar if present.         getmenuinflater().inflate(r.menu.main, menu);         return true; 

i same error @ r.menu.main, not options???

i having hard time r.java. tried possible fixes found @ forum none of them work. please. thanks

sometimes, eclipse default using android.r instead of com.your.package.r. go imports section , check importing package's r file.

then perform directory refresh , clean. should fix problem or expose problem.

it have cleaned project , have error in xml file, prevent r.java being generated.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -