Code example for SparseArray

Methods: size

0
        return mSections.get(position) != null;
    } 
 
    @Override 
    public int getCount() { 
        return (mValid ? mBaseAdapter.getCount() + mSections.size() : 0);
    } 
 
    @Override 
    public Object getItem(int position) {
        return isSectionHeaderPosition(position)
                ? mSections.get(position)
                : mBaseAdapter.getItem(sectionedPositionToPosition(position));
    } 
 
    @Override 
    public long getItemId(int position) {
        return isSectionHeaderPosition(position)
                ? Integer.MAX_VALUE - mSections.indexOfKey(position)
                : mBaseAdapter.getItemId(sectionedPositionToPosition(position));
    }