`

expandablelistview同时展开一个group

阅读更多

ExAdapter adapter;

ExpandableListView exList;

 

。。。。。。。。。。。。。。

adapter=new ExAdapter(DiseaseDetail.this);
        exList = (ExpandableListView) findViewById(R.id.list2);
        exList.setAdapter(adapter);
        exList.setGroupIndicator(null);
        exList.setDivider(null);
        exList.setOnGroupExpandListener(new OnGroupExpandListener(){

            @Override
            public void onGroupExpand(int arg0) {
                    // TODO Auto-generated method stub
                    for(int i=0;i<adapter.getGroupCount();i++)
                    {
                            if(arg0!=i)
                            {
                                exList.collapseGroup(i);
                            }
                    }
                                          
            }
                          
              });

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics