1

I am trying to implement expandable list in android.

  • In that list view when no child items available means it expand and lists some white spaces on my view.
  • I need to handle it like only the childs are available the group has to expand or else it has to avoid expanding parentview.

Can anyone give suggesstions.

Rajesh Loganathan
  • 11,129
  • 4
  • 78
  • 90
  • 1
    check this: http://stackoverflow.com/questions/11303314/expandablelistview-is-showing-indicator-for-groups-with-no-child – Lokesh Mar 11 '14 at 05:13
  • possible duplicate of [Sub Menu in App](http://stackoverflow.com/questions/20926524/sub-menu-in-app) – anddev84 Mar 11 '14 at 05:22

2 Answers2

1

By default getChildCount returns zero, and thus the ExpandedListView produces no children until it's overridden.

See that you haven't overidden this with a bad value, such as replacing the value there with another constant. You should put a function here that returns the correct number of children given position as a parameter.

NameSpace
  • 10,009
  • 3
  • 39
  • 40
0

override the method getChildView properly. It will resolve the issue and also make proper initialization of child arrays for each group item.