android - group view disappear in expandable list view -
i have expandable list view contain list view when after number of rows add other custom view. problem when try expand group 2nd time disappear.
thank's in advance. code wrote on getchildview:
if(childpos == currgroup.maxitems && currgroup.competitors.size() > currgroup.maxitems) { if(view == null) { view = inflater.inflate(r.layout.wizard_show_more_item, null, true); textview leauge_title = (textview) view.findviewbyid(r.id.show_more_title); leauge_title.settext(uiutils.getterm(context, "scores_game_show_more")); view.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent tourallcompetitorsintent = new intent(context, tournamentpromoallcompetitors.class); try { bytearrayoutputstream baos = new bytearrayoutputstream(); objectoutputstream oos; oos = new objectoutputstream(baos); oos.writeobject(currgroup); tourallcompetitorsintent.putextra("tournament", baos.tobytearray()); tourallcompetitorsintent.setaction(tournamentpromoallcompetitors.all_competitors); context.startactivity(tourallcompetitorsintent); } catch (ioexception e) {} } }); } } else { childeitemview holder = new childeitemview(); if (view == null) { compobj currcompetitor = getchild(grouppos, childpos); view = inflater.inflate(r.layout.competition_promo_child_item, viewgroup, false); holder.competitoricon = (imageview) view.findviewbyid(r.id.iv_competitor_icon); holder.competitortext = (textview) view.findviewbyid(r.id.tv_competitor); holder.selectedimage = (imageview) view.findviewbyid(r.id.iv_selected); holder.competitorid = currcompetitor.getid(); view.settag(holder); //view.setbackgroundresource(r.color.list_seperator); //holder.competitoricon.setimageresource(uiutils.getsporttyperes(getgroup(grouppos).sid , true)); holder.competitortext.settext(currcompetitor.getname()); string currcompetitorlogopath = competitorslogospath + string.valueof(getchild(grouppos, childpos).getid()) + "_70x70.png"; imageloader.displayimage(currcompetitorlogopath, holder.competitoricon, options); view.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { childeitemview viewhelper = (childeitemview)v.gettag(); if(viewhelper != null) { // if selected if(selectedcompetitors.contains(viewhelper.competitorid)) { selectedcompetitors.remove(viewhelper.competitorid); viewhelper.selectedimage.setimageresource(r.drawable.star_non_selected); tournamentactivity.updatenumofselectedcompetitors(); } else { selectedcompetitors.add(viewhelper.competitorid); viewhelper.selectedimage.setimageresource(r.drawable.star_selected); tournamentactivity.updatenumofselectedcompetitors(); } } } }); } else { holder = (childeitemview) view.gettag(); } return view;
Comments
Post a Comment