Code example for CursorIndexOutOfBoundsException

0
                case COLUMN_INDEX_SHORTCUT_ID:
                    return get().getShortcutId(); 
                case COLUMN_INDEX_SPINNER_WHILE_REFRESHING:
                    return String.valueOf(get().isSpinnerWhileRefreshing());
                default: 
                    throw new CursorIndexOutOfBoundsException("Requested column " + column
                            + " of " + COLUMNS.length);
            } 
        } else { 
            return getExtra(column);
        } 
    } 
 
    @Override 
    public long getLong(int column) {
        try { 
            return Long.valueOf(getString(column));
        } catch (NumberFormatException e) {
            return 0; 
        }