Code example for Cursor

Methods: getColumnIndexOrThrowgetLongisNull

  private static void addIntToStatement(SQLiteStatement statement, Cursor cursor,
                                        int index, String key)
    int columnIndex = cursor.getColumnIndexOrThrow(key);
    if (cursor.isNull(columnIndex)) {
    } else { 
      statement.bindLong(index, cursor.getLong(columnIndex));
  private static void getContentValuesForRow(Context context, MasterSecret masterSecret,
                                             Cursor cursor, long threadId,
                                             SQLiteStatement statement)
    addStringToStatement(statement, cursor, 1, SmsDatabase.ADDRESS);
    addIntToStatement(statement, cursor, 2, SmsDatabase.PERSON);
Connect your IDE to all the code out there  Get Codota for Java