im using expanded listview in my project, i need to expand the listview only one at a time, ie i expand a item and when try to expand another item in the list the previous item which i expanded has to collapse and the new item clicked has to expand, Answers will be greatly appreciated, i'm trying with the below snippet for the on click listener..
convertViewpar.setOnClickListener(new OnClickListener() {
int i=1;
public void onClick(View v) {
i = i++;
int[] expds = new int[100];
expds[0]=0;
expds[i] = groupPosition;
if(expds[i]==expds[i-1]){
if(isExpanded)
expandlist.collapseGroup(i);
else
expandlist.expandGroup(i);
}else{
expandlist.collapseGroup(i-1);
if(isExpanded)
expandlist.collapseGroup(i);
else
expandlist.expandGroup(i);
}
}
});