code: public static void cursorIntToContentValues(Cursor cursor, String field, ContentValues values,
              String key) {
          int colIndex = cursor.getColumnIndex(field);
          if (!cursor.isNull(colIndex)) {
              values.put(key, cursor.getInt(colIndex));
          } else {
              values.put(key, (Integer) null);
          }
      }
docs: Reads a Integer out of a field in a Cursor and writes it to a Map.
  
  @param cursor The cursor to read from
  @param field The INTEGER field to read
  @param values The {@link ContentValues} to put the value into, with the field as the key
  @param key The key to store the value with in the map