title: Android ExpandableListView using Holder for childViews with SeekBar. childViews are interdepending
body: <p>I'm trying to realize a layout with an ExpendableListView. There are 4 Group Elements and for each Group 2 Children. The first Group Element does have 0 Children.</p>
  
  <pre><code>G
  G
   C
   C
  G
   C
   C
  G
   C
   C
  </code></pre>
  
  <p>Every Group Element has 2 TextViews, 1 ImageView and 1 Switch.
  Every Child Element has 2 TextViews and 1 SeekBar.</p>
  
  <p>The Adapter contains 2 Holder. One for the Groupviews and one for the Childviews.</p>
  
  <p>On the Group Layer everything works as intented.</p>
  
  <p>But on the Child Layer the different ChildViews are interdependend. For example setting the SeekBar of Group Element3/Child Element1 sets the SeekBar of Group Element1/Child Element0 too.</p>
  
  <p>I do understand the problem has something to do with missing uniques of the views and view handling(optimizing) by Android.</p>
  
  <p>Here is the getChildView method:</p>
  
  <pre><code>@Override
  public View getChildView(int groupPosition, int childPosition,
      boolean isLastChild, View convertView, ViewGroup parent) {
  
  final int tempgroupPos = groupPosition;
  final int tempchildPos = childPosition;
  
  ChildViewHolder cviewHolder = null; 
  
  if (convertView == null) {  
      convertView = inflater.inflate(R.layout.interfaces_listrow_details_intervall, null);
  
      cviewHolder  = new ChildViewHolder();
  
      cviewHolder.tvb = (TextView) convertView.findViewById(R.id.interfaces_child_intervall_textbig);
      cviewHolder.tvs = (TextView) convertView.findViewById(R.id.interfaces_child_intervall_textexplanation);
      cviewHolder.sb = (SeekBar) convertView.findViewById(R.id.interfacesSeekBar);
  
      cviewHolder.sb.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
  
          @Override
          public void onStopTrackingTouch(SeekBar seekBar) {
              // TODO Auto-generated method stub      
          }
  
          @Override
          public void onStartTrackingTouch(SeekBar seekBar) {
              // TODO Auto-generated method stub      
          }
  
          @Override
          public void onProgressChanged(SeekBar seekBar, int progress,
                  boolean fromUser) {
  
              int getPosition = (Integer) seekBar.getTag();   
  
              clist.get(tempgroupPos).get(tempchildPos).setProgress(seekBar.getProgress());
  
              // do stuff
  
              notifyDataSetChanged();
          }
      });
  
      convertView.setTag(cviewHolder);
  
      convertView.setTag(R.id.interfaces_child_intervall_textbig, cviewHolder.tvb);
      convertView.setTag(R.id.interfaces_child_intervall_textexplanation, cviewHolder.tvs);
      convertView.setTag(R.id.interfacesSeekBar, cviewHolder.sb);
  
  } else {
      cviewHolder = (ChildViewHolder) convertView.getTag();
  }
  
  cviewHolder.sb.setTag(groupPosition);
  cviewHolder.sb.setProgress(clist.get(groupPosition).get(childPosition).getProgress());
  
  cviewHolder.tvb.setText(clist.get(groupPosition).get(childPosition).getBigText());  
  cviewHolder.tvs.setText(clist.get(groupPosition).get(childPosition).getSmallTextActivated());
  
  return convertView;
  }
  </code></pre>
  
  <p>If you need any other part of the code or other informations please ask.</p>
  
  <p>I looked into these Question/Answers but they did not really help me personally.</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/20821279/expandablelistview-shows-same-childviews-for-every-groupview">ExpandableListView shows same ChildViews for every GroupView</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/14668485/how-to-inflate-multiple-instances-of-a-layout-with-the-same-id-inside-an-inflate">How to inflate multiple instances of a layout with the same id inside an inflated layout</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/22583689/android-expandable-listview-using-viewholder-for-optimization">Android - Expandable ListView - using ViewHolder for optimization</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/21345972/do-i-need-multiple-viewholders-for-expandablelistview">Do I need multiple viewHolders for ExpandableListView?</a> </p></li>
  <li><p><a href="https://stackoverflow.com/questions/18997898/set-tag-to-every-child-in-expandable-list">set Tag to Every Child in expandable list</a></p></li>
  </ul>