title: Android Switch in ExpandableListView
body: <p>I have an ExpandableListView with a custom adapter. Each parent (or group) has a TextView and each child (items) has a textview and a switch. My ChildModel has a String name (TextView) and a String[] choices (switch). However, I believe my layouts are not getting inflated properly, because when I expand my ListView, the values on the switch change! Here's my code</p>
  
  <pre><code>    @Override
      public View getChildView(int groupPosition, int childPosition,
              boolean isLastChild, View convertView, ViewGroup parent) {
  
          View v = convertView;
  
          if (v == null) {
              LayoutInflater inflater = (LayoutInflater)ctx.getSystemService
                      (Context.LAYOUT_INFLATER_SERVICE);
              v = inflater.inflate(R.layout.listview_row_child, parent, false);
          }
  
          TextView itemName = (TextView) v.findViewById(R.id.itemName);
          Swith itemDescr = (Switch) v.findViewById(R.id.itemDescr);
  
          ChildModel det = catList.get(groupPosition).getItemList().get(childPosition);
  
          itemName.setText(det.getName());
  //      itemDescr.setText(det.getChoices()[0] + det.getChoices()[1]);
          itemDescr.setTextOff(det.getChoices()[0]);
          itemDescr.setTextOn(det.getChoices()[1]);
  
          return v;
  
      }
  </code></pre>
  
  <p>The part that I can't figure out is that if I changed the Switch to a TextView and use the line above that's comented out, it displays properly. Can someone explain to me why?
  Thanks!</p>
  
  <p>Notice how when I switch to a Switch the Toolbar Orientation now says "Yes/No" instead of "Left/Right" and my Units of Measurement doesn't even show "Meters/Feet" anymore </p>
  
  <p><img src="https://i.stack.imgur.com/KXpz7.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/mkYKY.png" alt="enter image description here"></p>