private static ContentValues getContentValues_selfMonitoringData(SelfAssessmentData data) { ContentValues values = new ContentValues(); values.put(Schema.HabitTable.Cols.AMOUNT, data.getAmount()); values.put(Schema.HabitTable.Cols.DATE, data.getDate()); values.put(Schema.HabitTable.Cols.FEELING, data.getFeeling().toString()); values.put(Schema.HabitTable.Cols.FOOD, data.getFood()); values.put(Schema.HabitTable.Cols.LOCATION, data.getLocation().toString()); values.put(Schema.HabitTable.Cols.SITUATION, data.getSituation().toString()); values.put(Schema.HabitTable.Cols.TIME, data.getTime().toString()); values.put(Schema.HabitTable.Cols.SENT, data.isSent()); return values; }
public void updateData(SelfAssessmentData data) { ContentValues values = getContentValues_selfMonitoringData(data); String date = data.getDate(); Database.update( Schema.HabitTable.NAME, values, Schema.HabitTable.Cols.DATE + "=?", new String[] {date}); }