android - Eclipse can't connect curly braces -
android - Eclipse can't connect curly braces -
im new android programming , im next tutorial: https://www.youtube.com/watch?v=pzarnvwkay4. followed tutorial eclipse manages find lots of errors. says curly braces incorrect, yet when select one, 1 corresponds lights , form pair. furthermore, eclipse doesn't recognise variables declared before oncreate method. here code:
package com.example.tutorialproject; import android.r; import android.app.activity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.radiogroup; import android.widget.radiogroup.oncheckedchangelistener; import android.widget.textview; public class tutorialone extends activity implements oncheckedchangelistener{ textview = textout; edittext = textin; radiogroup = gravityg, styleg; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.tutorial1); textout = (textview) findviewbyid(r.id.tvchange); textin = (edittext) findviewbyid(r.id.edittext1); gravityg = (radiogroup) findviewbyid(r.id.rggravity); styleg = (radiogroup) findviewbyid(r.id.rgstyle); button gen = (button) findviewbyid(r.id.bgenerate); gen.setonclicklistener(new view.onclicklistener() { public void onclick(view v){ textout.settext(textin.gettext()); } }); } @override public void oncheckedchanged(radiogroup group, int checkedid) { // todo auto-generated method stub switch (checkedid){ case r.id.rbleft: textout.setgravity(gravity.left); break; case r.id.rbcenter: textout.setgravity(gravity.center); break; case r.id.rbright: textout.setgravity(gravity.right); break; } } }
cut/paste , clean doesn't work, tried it. thought might problem? sorry long post.
thanks in advance
textview = textout; edittext = textin; radiogroup = gravityg, styleg;
get rid of =
. can find here nice introduction member variables
android eclipse
Comments
Post a Comment