childData.size() is not supposed to be 0 in your case (one group, no
children).
Quoteth the documentation:
childData A List of List of Maps. Each entry in the outer List
corresponds to a group (index by group position), each entry in the
inner List corresponds to a child within the group (index by child
position), and the Map corresponds to the data for a child (index by
values in the childFrom array). The Map contains the data for each
child, and should include all the entries specified in "childFrom"
Based on this, childData should have one entry, for the one group that
you have. That entry - in the outer map - should have an empty map as
its value (representing the group's absence of children).
This is quite different from using an empty childData.
So - like I already said - your groupData and childData are out of sync.
-- Kostya
03.11.2010 23:31, dashman пишет:
i think this should be easy to replicate - just create a subclass of
SimpleEx.. with 1 group entry and no children - click on the group
button
public class MyExpandableListAdapter extends
SimpleExpandableListAdapter
{
public MyExpandableListAdapter(
Context context,
List<Map<String, String>> groupData,
int groupLayout,
String[] groupFrom, int[] groupTo,
List<List<Map<String, String>>> childData,
int childLayout,
String[] childFrom, int[] childTo )
{
super( context, groupData, groupLayout, groupFrom,
groupTo, childData, childLayout, childFrom, childTo );
// here i made sure childData.size() was 0
}
public View getGroupView(int groupPosition, boolean
isExpanded, View convertView, ViewGroup parent)
{
// gets called once
}
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView,
ViewGroup parent)
{
// does not get called - that's correct
}
}
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
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