title: ExpandableListView - detect when all groups are collapsed
body: <p>I have an <code>ExpandableListView</code> and perform some actions when a group is expanded:</p>
  
  <pre><code>    @Override
  public void onGroupExpanded(int groupPosition) {
      super.onGroupExpanded(groupPosition);
      p = (RelativeLayout)activity.findViewById(R.id.pers);
      p.setVisibility(View.GONE);
      ExpandableListView elw = (ExpandableListView) activity
              .findViewById(android.R.id.list);
  
      if (groupPosition != lastExpandedGroupPosition) {
          elw.collapseGroup(lastExpandedGroupPosition);
      }
      lastExpandedGroupPosition = groupPosition;
  
  }
  </code></pre>
  
  <p>I need to set the <code>RelativeLayout</code> visible when ALL groups are collapsed (or when no group is expanded). How can I detect that all groups are currently collapsed?</p>