Code example for CursorAdapter

Methods: getItem

0
    @Override 
    public Object getItem(int position) {
        if (isAllTracksItem(position) || isLevel2Header(position)) {
            return null; 
        } 
        return super.getItem(adapterPositionToCursorPosition(position));
    } 
 
    @Override 
    public long getItemId(int position) {
        if (isAllTracksItem(position)) {
            return ALL_ITEM_ID;
        } else if (isLevel2Header(position)) {
            return LEVEL_2_SECTION_HEADER_ITEM_ID;
        } 
        return super.getItemId(adapterPositionToCursorPosition(position));
    } 
 
    @Override 
    public boolean areAllItemsEnabled() { 
        return false;