android - Why are my ending marks red underlined? -
in code ending marks in onitemclick(adapterview red, , have no idea why... have look:
public class myactivity3 extends activity { private textview tv; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_my3); button m = (button) findviewbyid(r.id.button3); tv = (textview) findviewbyid(r.id.textviewcat); typeface typeface = typeface.createfromasset(getassets(), "bebasneue bold.ttf"); tv.settypeface(typeface); string listarray[] = new string[] { "all", "friends & family", "sports", "outside", "at school", "fitness", "photography", "food", "beach", "money" }; listview listview = (listview) findviewbyid(r.id.listview); list<hashmap<string, string>> alist = new arraylist<hashmap<string, string>>(); (int = 0; <= listarray.length - 1; i++) { hashmap<string, string> hm = new hashmap<string, string>(); hm.put("title", listarray[i]); alist.add(hm); } string[] sfrm = { "title"}; int[] sto = { r.id.title}; simpleadapter adapter = new simpleadapter(getbasecontext(), alist, r.layout.row_layout, sfrm, sto); listview.setadapter(adapter); listview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> arg0, view view,int position, long id) { checkbox cb = (checkbox) view.findviewbyid(r.id.chk); cb.setchecked(!cb.ischecked()); } } }); } @override public void onbackpressed() { super.onbackpressed(); overridependingtransition(r.anim.animation8, r.anim.animation7); } }
i'd grateful solution, bugging me hell. in advance... :)
edit: here's screenie:
you have closed 1 }
doesn't needed closed.
public class myactivity3 extends activity { private textview tv; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_my3); button m = (button) findviewbyid(r.id.button3); tv = (textview) findviewbyid(r.id.textviewcat); typeface typeface = typeface.createfromasset(getassets(), "bebasneue bold.ttf"); tv.settypeface(typeface); string listarray[] = new string[] { "all", "friends & family", "sports", "outside", "at school", "fitness", "photography", "food", "beach", "money" }; listview listview = (listview) findviewbyid(r.id.listview); list<hashmap<string, string>> alist = new arraylist<hashmap<string, string>>(); (int = 0; <= listarray.length - 1; i++) { hashmap<string, string> hm = new hashmap<string, string>(); hm.put("title", listarray[i]); alist.add(hm); } string[] sfrm = { "title" }; int[] sto = { r.id.title }; simpleadapter adapter = new simpleadapter(getbasecontext(), alist, r.layout.row_layout, sfrm, sto); listview.setadapter(adapter); listview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> arg0, view view, int position, long id) { checkbox cb = (checkbox) view.findviewbyid(r.id.chk); cb.setchecked(!cb.ischecked()); } }); } @override public void onbackpressed() { super.onbackpressed(); overridependingtransition(r.anim.animation8, r.anim.animation7); }
Comments
Post a Comment