title: ExpandableListView Change Indicator State
body: <p>I have an ExpandableListView setup working very properly and as I wanted but with a minor problem I want the group indicator (the arrow) to expand and collapse when I open or close the group. This function is although partially working but not fully correct. </p>
  
  <p>The problem is that when I expand lets say group1 the indicator of group2 automatically gets invisible (Image at the end of post). and if I continue to expsnd group3 then the indicator of group4 hides. at the end only the terminal groups i.e ending groups have the indicator, the indicators of all other groups are invisible. I tried debugging this very hard but could find any reason as to why this is happening. Maybe you all can take a look!</p>
  
  <p><strong>This is the <em>activity_main.xml</em> (Yes I am Using Android Navigation Drawer Here)</strong></p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;!-- The main content view --&gt;
  
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
      &lt;!-- The navigation drawer --&gt;
  
      &lt;ExpandableListView
          android:id="@+id/left_drawer"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:groupIndicator="@null"
          android:divider="#F3F3F3"
          android:padding="1dp"
          android:dividerHeight="1dp"
          android:background="#FFFFFF" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong><em>drawer_group_item.xml</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
    &lt;TextView
          android:id="@+id/group_title"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:textSize="24sp"
          android:gravity="left"
          android:minHeight="30dp"
          android:paddingLeft="20dp"
          android:paddingTop="10dp"
          android:paddingBottom="10dp"
          android:textColor="#616161"
          android:text="Hello"
          android:paddingRight="40dp" /&gt;
  
      &lt;ImageView
          android:id="@+id/indicator"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_alignParentRight="true"
          android:layout_centerVertical="true"
          android:paddingRight="10dp"
          android:src="@drawable/ic_action_expand" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong><em>drawer_list_item</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
      &lt;ImageView
          android:id="@+id/store_image"
          android:layout_width="30dp"
          android:layout_height="30dp"
          android:layout_gravity="center_vertical"
          android:padding="5dp"
          android:scaleType="fitXY" /&gt;
  
      &lt;TextView
          android:id="@+id/title"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical"
          android:paddingBottom="10dp"
          android:paddingLeft="10dp"
          android:paddingTop="10dp"
          android:textColor="#616161"
          android:textSize="24sp" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong><em>getGroupView from the adapter</em></strong></p>
  
  <pre><code>@Override
  public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
  
  
  ViewHolder holder = null;
  
  if (convertView == null) {
      holder = new ViewHolder();
      convertView = inflater.inflate(R.layout.drawer_group_item, null);
      holder.imageView = (ImageView) convertView.findViewById(R.id.indicator);
      holder.textView = (TextView) convertView.findViewById(R.id.group_title);
      convertView.setTag(holder);
  }else{
      holder = (ViewHolder) convertView.getTag();
  }
  
  holder.textView.setText(parentItems.get(groupPosition));
  
  if(groupPosition == 0 || groupPosition == 5){
      holder.imageView.setVisibility(View.GONE);
  }
  
  if(isExpanded){
      holder.imageView.setImageResource(R.drawable.ic_action_collapse);
  }
  if(!isExpanded){
      holder.imageView.setImageResource(isExpanded?R.drawable.ic_action_collapse:R.drawable.ic_action_expand);
  }
  
  return convertView;
  </code></pre>
  
  <p>}</p>
  
  <p>Image: <a href="http://imgur.com/JzsVdQz" rel="nofollow">http://imgur.com/JzsVdQz</a></p>
  
  <p>Image order is right to left (sorry about that)</p>
  
  <p><strong>EDIT</strong>: I also want some categories to not expand. like if there is a group which doesnot have subitems I want to hide the indicator for that group. I am using this code currently</p>
  
  <pre><code>if(groupPosition == 0 || groupPosition == 5){
          holder.imageView.setVisibility(View.GONE);
  }
  </code></pre>
  
  <p>but how do i hide the indicator in the statelist xml and setIndicatorBounds method (as stated by user3664308)</p>