How to keep the ExpandableListView Opened?

后端 未结 3 1889
别跟我提以往
别跟我提以往 2021-02-07 08:56

I am working on the ExpandableListView I have completed the work, now only one thing that I want to do is I don\'t want the ListView to be DropDown on click of the Expandable Li

3条回答
  •  忘掉有多难
    2021-02-07 09:29

    Do this for every one of the groups to expand them:

    listView1.expandGroup(int groupPosition);
    

    If you want to prevent group collapse, then do this:

    listView1.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener()
    {
        public boolean onGroupClick(ExpandableListView arg0, View itemView, int itemPosition, long itemId)
        {
            listView1.expandGroup(itemPosition);
            return true;
        }
    });
    

提交回复
热议问题