title: Android Expandable ListView on expand
body: <p>Is there a way to change an imageview within my group row when the group is expanded?</p>
  
  <p>I am looking for a way to do this via the code.</p>
  
  <p>Cheers for any tips</p>
  
  <p>EDIT: This is what I am trying to use at the moment, but it does not swap the image</p>
  
  <pre><code>    private static final int[] EMPTY_STATE_SET = {};
      private static final int[] GROUP_EXPANDED_STATE_SET = {android.R.attr.state_expanded};
      private static final int [] [] GROUP_STATE_SETS = {
          EMPTY_STATE_SET, //0
          GROUP_EXPANDED_STATE_SET //1
      };
  
      public View getGroupView (int groupPosition,
          boolean isExpanded,
          View convertView,
          ViewGroup parent) {
  
          View v = getGroupView( groupPosition, isExpanded, convertView, parent);
          View ind = v.findViewById(R.id.explist_indicator);
          if(ind != null){
              ImageView indicator = (ImageView) ind;
              indicator.setVisibility( View.VISIBLE );
              int stateSetIndex = ( isExpanded ? 1:0);
              Drawable drawable = indicator.getDrawable();
              drawable.setState(GROUP_STATE_SETS[stateSetIndex]);
          }
          return v;
      }
  </code></pre>