title: ListView inside ExpandableListView is showing always the last element repeated in all items
body: <p>I want to show a ListView when I expand the items of an ExpandableListView. This is the adapter for ExpandableListView:</p>
  
  <pre><code>public class ExpandableListAdapterDay extends BaseExpandableListAdapter{
  
  private Activity _context;
  private ArrayList&lt;String&gt; _listDataHeader; // header titles
  private HashMap&lt;String, ArrayList&lt;DataDay&gt;&gt; _listDataChild;
  
  private static class ViewHolderChild {
  
      public final ListView listDay;
  
      public ViewHolderChild(ListView listDay) {
          this.listDay = listDay;
      }
  }
  
  private static class ViewHolderGroup {
  
      public final TextView textHeader;
  
      public ViewHolderGroup(TextView textHeader) {
          this.textHeader = textHeader;
      }
  }
  
  public ExpandableListAdapterDay(Activity context, ArrayList&lt;String&gt; listDataHeader,
          HashMap&lt;String, ArrayList&lt;DataDay&gt;&gt; listChildData) {
      this._context = context;
      this._listDataHeader = listDataHeader;
      this._listDataChild = listChildData;
  }
  
  
  @Override
  public int getGroupCount() {
      // TODO Auto-generated method stub
      return this._listDataHeader.size();
  }
  
  @Override
  public int getChildrenCount(int groupPosition) {
      // TODO Auto-generated method stub
      return this._listDataChild.get(this._listDataHeader.get(groupPosition)).size();
  }
  
  @Override
  public Object getGroup(int groupPosition) {
      // TODO Auto-generated method stub
      return this._listDataHeader.get(groupPosition);
  }
  
  @Override
  public Object getChild(int groupPosition, int childPosition) {
      // TODO Auto-generated method stub
      return this._listDataChild.get(this._listDataHeader.get(groupPosition));
              //.get(childPosition);
  }
  
  @Override
  public long getGroupId(int groupPosition) {
      // TODO Auto-generated method stub
      return groupPosition;
  }
  
  @Override
  public long getChildId(int groupPosition, int childPosition) {
      // TODO Auto-generated method stub
      return childPosition;
  }
  
  @Override
  public boolean hasStableIds() {
      // TODO Auto-generated method stub
      return false;
  }
  
  @Override
  public View getGroupView(int groupPosition, boolean isExpanded,
          View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
  
      TextView textHeader;
      String strDataHeader = (String) getGroup(groupPosition);
  
      if (convertView == null) {
          LayoutInflater infalInflater = (LayoutInflater) this._context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = infalInflater.inflate(R.layout.list_group_day, null);
  
            textHeader = (TextView) convertView.findViewById(R.id.textHeaderDay);
            convertView.setTag(new ViewHolderGroup(textHeader));
      } else {
          ViewHolderGroup viewHolder = (ViewHolderGroup) convertView.getTag();
  
          textHeader = viewHolder.textHeader;
      }
  
      textHeader.setTypeface(null, Typeface.BOLD);
      textHeader.setText(strDataHeader);
  
      return convertView;
  }
  
  @Override
  public View getChildView(int groupPosition, int childPosition,
          boolean isLastChild, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
  
      ListView listDay;
  
      final ArrayList&lt;DataDay&gt; arrayDay = (ArrayList&lt;DataDay&gt;) getChild(groupPosition, childPosition);
  
      if (convertView == null) {
          LayoutInflater infalInflater = (LayoutInflater) this._context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = infalInflater.inflate(R.layout.list_item_day, null);
  
          listDay = (ListView) convertView.findViewById(R.id.listDay);
  
          convertView.setTag(new ViewHolderChild(listDay));
      } else { 
  
          ViewHolderChild viewHolder = (ViewHolderChild) convertView.getTag();
  
          listDay = viewHolder.listDay;
      }
  
      AdapterDataDay adapter = new AdapterDataDay (_context, arrayDay);
      listDay.setAdapter(adapter);
  
  
      return convertView;
  
  }
  
  @Override
  public boolean isChildSelectable(int groupPosition, int childPosition) {
      // TODO Auto-generated method stub
      return true;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And this is the adapter for the ListView that I want to show when I expand the ExpandableListView:</p>
  
  <pre><code>public class AdapterDataDay extends BaseAdapter{
  
  protected Context activity;
  protected ArrayList&lt;DataDay&gt; arrayItem;
  
  private static class ViewHolder {
  
      public TextView textDate;
      public TextViewEx textItem;
  
      public ViewHolder() {
      }
  }
  
  public AdapterDatosOraciones(Context activity, ArrayList&lt;DataDay&gt; items) {
      this.activity = activity;
      this.arrayItem = items;
  }
  
  
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
      return arrayItem.size();
  }
  
  @Override
  public Object getItem(int arg0) {
      // TODO Auto-generated method stub
      return arrayItem.get(arg0);
  }
  
  @Override
  public long getItemId(int position) {
      // TODO Auto-generated method stub
      return arrayItem.get(position).getId();
  }
  
  
  @SuppressLint("NewApi")
  @Override
  public View getView(int position, View convertView, ViewGroup arg2) {
  
      ViewHolder holder;
  
      if(convertView == null){
          LayoutInflater inf = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = inf.inflate(R.layout.list_item_day_listview, null);
  
          holder = new ViewHolder();
  
          holder.textDate = (TextView) convertView.findViewById(R.id.textDate);
          holder.textItem = (TextViewEx) convertView.findViewById(R.id.textItem);
  
          convertView.setTag(holder);
      } else {
          holder = (ViewHolder) convertView.getTag();
      }
  
      DataDay data = arrayItem.get(position);
  
  
      holder.textDate.setText(data.strDate);
      holder.textItem.setText(data.strItem, true);
  
      return convertView;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem is that when I expand the items of ExpandableListView all the items of ListView are the same, always appear the same item in all ListView. What I can be doing incorrectly? </p>
  
  <p>Thanks in advance.</p>