expandablelistview - Collapse all group except selected group in expandable listview android -


i'm developing android application using expandable list view. need is, i'm listing group, contains child.

if select unexpandable group, should expand, after ll select second group @ time first group should collapsed. did google, couldn't find want. please me out.

have current expanded group position stored in variable. in ongroupexpanded following.

private int lastexpandedposition = -1; private expandablelistview lv; //your expandable listview ...  lv.setongroupexpandlistener(new ongroupexpandlistener() {      @override     public void ongroupexpand(int groupposition) {             if (lastexpandedposition != -1                     && groupposition != lastexpandedposition) {                 lv.collapsegroup(lastexpandedposition);             }             lastexpandedposition = groupposition;     } }); 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -