I apologize for my English, but translated using Google. I need help for my application, I use ExpandableListView with three different layouts, but I am having problems not finding the answer in different forums. Basically, if the getChildView () method checks to see if the conversion is zero, I shift all layouts or even repeat them several times. If I do not do this check, you will see the layout as it should, but the values in the EditText are erased if I click on another group, or if you look at the list until you see more layout using EditText. I hope I was clear enough, and I hope the answers are equally clear, unfortunately I was everywhere on the Internet, but could not find the answer I was looking for. Thanks in advance to those who will help me.
public View getChildView(int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
View view = convertView;
ViewHolder holder;
if (view == null) {
holder = new ViewHolder();
if (groupPosition == 0) {
convertView = infalInflater.inflate(R.layout.adv_item, null);
holder.btn1 = (ImageButton) convertView
.findViewById(R.id.button1);
holder.btn2 = (ImageButton) convertView
.findViewById(R.id.button2);
holder.btn3 = (ImageButton) convertView
.findViewById(R.id.button3);
holder.et1 = (EditText) convertView.findViewById(R.id.editText1);
holder.et2 = (EditText) convertView.findViewById(R.id.editText2);
holder.et3 = (EditText) convertView.findViewById(R.id.editText3);
holder.et4 = (EditText) convertView.findViewById(R.id.editText4);
holder.et5 = (EditText) convertView.findViewById(R.id.editText5);
holder.et6 = (EditText) convertView.findViewById(R.id.editText6);
holder.check_sc1 = (CheckBox) convertView
.findViewById(R.id.item_check_sc1);
holder.check_sc2 = (CheckBox) convertView
.findViewById(R.id.item_check_sc2);
holder.check_sc3 = (CheckBox) convertView
.findViewById(R.id.item_check_sc3);
holder.check_oo = (CheckBox) convertView
.findViewById(R.id.item_check_oo);
convertView.setTag(holder);
}
if (groupPosition == 1) {
convertView = infalInflater.inflate(R.layout.visual_item, null);
}
if (groupPosition == 2) {
convertView = infalInflater.inflate(R.layout.routes_item, null);
}
} else {
holder = (ViewHolder) convertView.getTag();
}
return convertView;
}