\r
ExpandableListAdapter configurationAdapter = new BaseExpandableListAdapter() {\r
\r
+ // Note: the magic 1 you see below is so the "no motors" configuration\r
+ // does not appear in the configuration list.\r
List<MotorMount> mmts = rocketDocument.getRocket().getMotorMounts();\r
\r
@Override\r
public int getGroupCount() {\r
- return rocketDocument.getRocket().getMotorConfigurationIDs().length;\r
+ // don't show the "no motors" configuration, so we have one less than the\r
+ // array length.\r
+ return rocketDocument.getRocket().getMotorConfigurationIDs().length-1;\r
}\r
\r
@Override\r
\r
@Override\r
public Object getGroup(int groupPosition) {\r
- String config = rocketDocument.getRocket().getMotorConfigurationIDs()[groupPosition];\r
+ // Skip over the "no motors" configuration\r
+ String config = rocketDocument.getRocket().getMotorConfigurationIDs()[groupPosition+1];\r
return config;\r
}\r
\r