Skip to content Skip to sidebar Skip to footer

Expandablelistview How To Auto Groupexpand - Android

Can anyone please help me how to automatically expand the group in my Expandable Listview, I only have one group. with 5 items. I want to expand it automatically so I don't have to

Solution 1:

do this way:

                expList.setAdapter(mNewAdapter);

                for (inti=0; i < mNewAdapter.getGroupCount(); i++)
                    expList.expandGroup(i);


                expList.setOnGroupClickListener(newOnGroupClickListener() {
                    @OverridepublicbooleanonGroupClick(ExpandableListView parent,
                            View v, int groupPosition, long id) {
                        returntrue; // This way the expander cannot be// collapsed
                    }
                });

and:

<ExpandableListViewandroid:id="@+id/e_lodinfo"android:layout_width="match_parent"android:layout_height="wrap_content"android:scrollbars="none"android:groupIndicator="@null"
         ></ExpandableListView>

Solution 2:

Post a Comment for "Expandablelistview How To Auto Groupexpand - Android"