Shouldn't you just override getChildrenCount(int) to return the number
of children for that particular group, rather than the maximum over
all groups?

On Jul 26, 5:07 am, Pravin Parulekar <[email protected]> wrote:
> Hello Gurus,
> I am using a simple expandable list that is populated by two arrays
> ( group array for the groups and a multi dimensional children array
> for the child).
>
> The arrays are built dynamically in the program and some group items
> have more children than others. So I end up defining the highest
> number as the array size for the multidimensional child array.
> After populating the child array, some positions are left null, as
> there are no values for those group items (explained above).
> When I associate this with the expandable list adapter, the
> getChildView method throws a nullpointer exception when it comes
> across a position in child array that does noto have value.
> I have two questions:
>
> 1. Can I make the base adapter skip the shildview method if the value
> in that child is null? The current implementation of getchildView
> method has to return a view and even if I suppress the nullpointer
> exception, it adds a blank element in the child position in the list.
>
> 2. Is there a better way of associated multidimensional arrays that
> are populated at run time? The current set of examples only use
> hardcoded string array values. Even the cursor adapters examples use
> very basic setup.
>
> thank you so much for your attention and response.
>
> Best, Pravin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to