/** {@inheritDoc} */ public View getView(int pos, View convertView, ViewGroup parent) { int sectionNum = 0; for (Object section : mSections.keySet()) { BaseAdapter adapter = mSections.get(section); int size = adapter.getCount() + 1; if (pos == 0) { return mHeaderAdapter.getView(sectionNum, null, parent); } if (pos < size) { return adapter.getView(pos - 1, null, parent); } pos -= size; sectionNum++; } return null; }
/** @since 1 */ public void clearItems() { mHeaderAdapter.clear(); mSections.clear(); notifyDataSetChanged(); }
public void addSection(String section, BaseAdapter adapter) { mHeaderAdapter.add(section); mSections.put(section, adapter); }