title: Expandable list view listener does not work when activity is recreated
body: <p>I have an expandable list view in a fragment and have set the list to expand only one row at a time in onGroupExpand function of the list.
   Everything works fine while activity is running. Once activity is resumed back from saved instance state the function onGroupExpand is never called. I tried to reset the listener for list but still its not working.</p>
  
  <p>Below is the code for controlling the group expand function.</p>
  
  <pre><code>    private void setListExpandListener()
          {
              final ExpandableListView list = (ExpandableListView)getActivity().findViewById(android.R.id.list);
              list.setEmptyView(getView().findViewById(R.id.no_mixes_empty_list_view));
              list.setOnGroupExpandListener(new OnGroupExpandListener() 
              {   
                  @Override
                  public void onGroupExpand(int groupPosition) 
                  { 
                      collapseGroupAtPosition(list, groupPosition);
                  }
              });
          }
  
  
  
   private void collapseGroupAtPosition(ExpandableListView list,int position)
          {
              if (parentRowPosition != -1 &amp;&amp; parentRowPosition != position) 
              {
                  list.collapseGroup(parentRowPosition);  
              }
              parentRowPosition = position;
          }
  </code></pre>
  
  <p>I am trying to save the state of variable parentRowPosition and retrieve in restore state of fragment.</p>
  
  <p>The retrieval works fine but the listener now does not work and all the rows of list can be expanded at a time.</p>
  
  <p>Here is the code where listener is being set:- </p>
  
  <pre><code>    public void onViewCreated(View view, Bundle savedInstanceState)
          {
              mAdapter = new SavedTankExpandableListAdapter(getActivity());
              mAdapter.setDeleteListener(this);
              setListExpandListener();
              setListenersForViews();
              setOverlayAccordingToAppLaunchCount();
              super.onViewCreated(view, savedInstanceState);
  
          }
  
       public void onActivityCreated(Bundle savedInstanceState) 
              {
                  super.onActivityCreated(savedInstanceState);
                  onRestoreState(savedInstanceState);
              }
  
      public void onRestoreState(Bundle savedInstanceState)
  {
      if(savedInstanceState==null)
          return;
      parentRowPosition=savedInstanceState.getInt("parentRowPosition",0);
  
      Utility.LHTLogs("Parent Row Position "+ parentRowPosition, true);
      if(mAdapter==null)
          mAdapter = new SavedTankExpandableListAdapter(getActivity());
      setListExpandListener();
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>