Ejemplo n.º 1
0
  public Message CursorToMessage(Cursor cursor) {
    Message message = new Message();
    message.setContentType(
        cursor.getInt(cursor.getColumnIndex(DataBaseHelper.message_contentType)));
    message.setStatus(cursor.getInt(cursor.getColumnIndex(DataBaseHelper.message_status)));
    message.setFK_receiverUserId(
        cursor.getLong(cursor.getColumnIndex(DataBaseHelper.message_FK_receiverUserId)));
    message.setContent(cursor.getString(cursor.getColumnIndex(DataBaseHelper.message_Content)));
    message.setFK_senderUserId(
        cursor.getLong(cursor.getColumnIndex(DataBaseHelper.message_FK_senderUserId)));
    message.setDate(cursor.getString(cursor.getColumnIndex(DataBaseHelper.message_date)));
    message.setType(cursor.getInt(cursor.getColumnIndex(DataBaseHelper.message_type)));
    message.setMessageId(cursor.getLong(cursor.getColumnIndex(DataBaseHelper.message_messageId)));
    message.setInput(cursor.getInt(cursor.getColumnIndex(DataBaseHelper.message_input)));

    return message;
  }