java - Does anyone know why I am getting the following error?: Syntax error on token(s), misplaced construct(s) -


hi can me problem. using eclipse android , have created number of buttons , have labelled them correctlt(made sure did) , set them id have included in strings file. when go set butotn onclicklistener , create onclick method error outlined above. there red error lines on dot (period) between button1 , setonclicklistener. dont know going on here. ive included xml , strings classes. n.b. there more code main.java activity dont think necessary question.

thanks help!

@override     public boolean oncreateoptionsmenu(menu menu) {         // inflate menu; adds items action bar if present.         getmenuinflater().inflate(r.menu.main, menu);         return true;     }      button button1 = (button) findviewbyid(r.id.button1);     button1.setonclicklistener (new view.onclicklistener) {      } 

the method in java sample ends @ brace right after "return" statement; next 2 lines outside of method, , 1 errors, being statement, illegal outside of method.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -