From 911dfb5a994143e4d14a125db305ff1e8cc4683d Mon Sep 17 00:00:00 2001 From: jacques Date: Sun, 3 May 2020 20:32:23 +0200 Subject: [PATCH] Add debug code --- app/src/main/java/net/foucry/pilldroid/DBHelper.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/DBHelper.java b/app/src/main/java/net/foucry/pilldroid/DBHelper.java index 94356ad..3600331 100644 --- a/app/src/main/java/net/foucry/pilldroid/DBHelper.java +++ b/app/src/main/java/net/foucry/pilldroid/DBHelper.java @@ -262,7 +262,7 @@ class DBHelper extends SQLiteOpenHelper { */ public void updateDrug(Medicament medicament) { - Log.d(TAG, "Update Drug == " + medicament.toString()); + Log.d(TAG, "Update Drug == " + medicament); // Get reference to writable DB SQLiteDatabase db = this.getWritableDatabase(); @@ -276,6 +276,7 @@ class DBHelper extends SQLiteOpenHelper { values.put(KEY_PRES, medicament.getPresentation()); values.put(KEY_STOCK, medicament.getStock()); + Log.d(TAG, "values are " +values.toString()); // Update row int i = db.update(TABLE_DRUG, // table values, // column/value @@ -286,6 +287,11 @@ class DBHelper extends SQLiteOpenHelper { // Close DB db.close(); + // DEBUG + Medicament toto = getDrug(medicament.getId()); + Log.d(TAG, "toto stock== " + toto.getStock()); + + } /** @@ -305,7 +311,7 @@ class DBHelper extends SQLiteOpenHelper { db.close(); // log - Log.d(TAG, "delete drug "+medicament.toString()); + Log.d(TAG, "delete drug "+medicament); } /**