title: ExpandableList getChildView running twice per child
body: <p>I've got and <code>ExpandableList</code> which I assign to an extended <code>BaseExpandableListAdapter</code>. In here, I implement the <code>getChildView</code> method to setup and return a View for each child:</p>
  
  <pre><code>public View getChildView(int groupIndex, int childIndex, boolean isLastChild, View convertView, ViewGroup parent) {
  
      LinearLayout layout;
      if (convertView == null) {
              layout = (LinearLayout) LayoutInflater.from(MyApp.getContext()).inflate(R.layout.rooms_room_list_row, parent, false);
          } else {
              layout = (LinearLayout) convertView; 
          }
  
      // Do some custom stuff with views on the layout
      ...
  
      return layout;
  
  }
  </code></pre>
  
  <p>While debugging, I've noticed that <code>getChildView</code> is executed twice per child. All the values passed in (i.e, groupIndex, childIndex, isLastChild) are the same... so in group 3, if I've got two children, I'll see:</p>
  
  <p><code>groupIndex = 3</code>, <code>childIndex = 0</code></p>
  
  <p>then </p>
  
  <p><code>groupIndex = 3</code>, <code>childIndex = 1</code></p>
  
  <p>then it repeats:</p>
  
  <p><code>groupIndex = 3</code>, <code>childIndex = 0</code></p>
  
  <p>and finally:</p>
  
  <p><code>groupIndex = 3</code>, <code>childIndex = 1</code></p>
  
  <p>My view appears fine, i.e, there are only two children listed for the group, but why is it doing all the extra work?</p>
  
  <p><strong>UPDATE &amp; ANSWER</strong></p>
  
  <p>It seems that if the the listview is set to a height of <code>wrap_content</code> then the <code>getChildView</code> will be called twice per child. Changing the height to <code>fill_parent</code> seems to fix this behavior.</p>