Dhamodharan Android
Dhamodharan Android

Reputation: 61

avoid expanding list in android when no childitems

I am trying to implement expandable list in android.

Can anyone give suggesstions.

Upvotes: 1

Views: 81

Answers (2)

NameSpace
NameSpace

Reputation: 10177

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.

Upvotes: 1

Abhishek choudhary
Abhishek choudhary

Reputation: 209

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

Upvotes: 0

Related Questions