@Override PublicView Getchildview (Final intGroupposition,Final intChildposition,BooleanIslastchild, View Convertview, ViewGroup parent) {LOG.D (TAG,"Getchildview () group=" +groupposition+ ", child=" +childposition); FinalString children =(String) getchild (groupposition,childposition); if(Convertview = =NULL|| Children! =( (Viewholder) Convertview.gettag ()). Text.gettext ()) {LOG.D (TAG,"Getchildview ()-Initialize Converview"); Layoutinflater Inflater=Layoutinflater.from (context); Convertview= Inflater.inflate (R.layout.expandable_list_row,NULL); Viewholder Viewholder=NewViewholder (); Viewholder.text=(TextView) Convertview.findviewbyid (R.ID.TEXTVIEW1); Viewholder.image=(ImageView) Convertview.findviewbyid (R.id.imagecheck); Convertview.settag (Viewholder); Convertview.setonclicklistener (NewView.onclicklistener () {@Override Public voidOnClick (View v) {LOG.E ("Test", "group=" +groupposition+ ", child=" +childposition); FinalImageView Imagecheck =(ImageView) V.findviewbyid (R.id.imagecheck); Imagecheck.setvisibility (imageview.visible); intDialogType =Getantecedenttype (groupposition, childposition); intAntecedentid =Getantecedentid (groupposition, childposition); if(Antecedentid! =-1) {Medicalantecedentdialog dialog=Dialogs.get (Antecedentid); if(Dialog! =NULL) {dialog.show (); } Else{medicalantecedentdialog dialog2=NewMedicalantecedentdialog (context, children, dialogtype); Dialogs.append (Antecedentid, DIALOG2); Dialog2.show (); } } } }); } Viewholder Holder=(Viewholder) Convertview.gettag (); Holder.text.setText (children); returnConvertview; }
There's a problem here:
If (Convertview = = null | | Children!= "Getchildview ()-Initialize Converview" ); The first 9 items in the
Group1 are initialized, and the tenth and 11th are not, and the 12th element is initialized correctly. Don't know why ...