@Implementation public long getItemIdAtPosition(int position) { Adapter adapter = getAdapter(); return (adapter == null || position < 0) ? AdapterView.INVALID_ROW_ID : adapter.getItemId(position); }
@Override public long getItemId(int position) { for (int i = 0; i < headers.getCount(); i++) { String section = headers.getItem(i); Adapter adapter = sections.get(section); if (adapter.getCount() > 0) { int size = adapter.getCount() + 1; // check if position inside this section if (position < size) return adapter.getItemId(position - 1); // otherwise jump into next section position -= size; } } return -1; }