From 4486b45bd995647d272f0ac964327473b6280f99 Mon Sep 17 00:00:00 2001 From: jacques Date: Sat, 26 Jun 2021 17:51:05 +0200 Subject: [PATCH] fix typo --- app/src/main/java/net/foucry/pilldroid/DBHelper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/DBHelper.java b/app/src/main/java/net/foucry/pilldroid/DBHelper.java index cff3dfc..36a9fbe 100644 --- a/app/src/main/java/net/foucry/pilldroid/DBHelper.java +++ b/app/src/main/java/net/foucry/pilldroid/DBHelper.java @@ -151,7 +151,7 @@ class DBHelper extends SQLiteOpenHelper { drug.setId(Integer.parseInt(cursor.getString(0))); drug.setCis(cursor.getString(1)); drug.setCip13(cursor.getString(2)); - drug.setNama(cursor.getString(3)); + drug.setName(cursor.getString(3)); drug.setAdministration_mode(cursor.getString(4)); drug.setPresentation(cursor.getString(5)); drug.setStock(Double.parseDouble(cursor.getString(6))); @@ -199,7 +199,7 @@ class DBHelper extends SQLiteOpenHelper { drug.setId(Integer.parseInt(cursor.getString(0))); drug.setCis(cursor.getString(1)); drug.setCip13(cursor.getString(2)); - drug.setNama(cursor.getString(3)); + drug.setName(cursor.getString(3)); drug.setAdministration_mode(cursor.getString(4)); drug.setPresentation(cursor.getString(5)); drug.setStock(Double.parseDouble(cursor.getString(6))); @@ -241,7 +241,7 @@ class DBHelper extends SQLiteOpenHelper { drug.setId(Integer.parseInt(cursor.getString(0))); drug.setCis(cursor.getString(1)); drug.setCip13(cursor.getString(2)); - drug.setNama(cursor.getString(3)); + drug.setName(cursor.getString(3)); drug.setAdministration_mode(cursor.getString(4)); drug.setPresentation(cursor.getString(5)); drug.setStock(Double.parseDouble(cursor.getString(6))); @@ -291,13 +291,14 @@ class DBHelper extends SQLiteOpenHelper { Log.d(TAG, "After sort " + drugs.toString()); // Move drug with prise = 0 at the end of the list + // todo: If some drug moved, must redo all the loop for (int position = 0 ; position < getCount() ; position++ ) { currentDrug = getItem(position); double currentTake = currentDrug.getTake(); if (currentTake == 0) { drug = drugs.remove(position); - drugs.add(drugs.size(), drug); + drugs.add(drug); } } return drugs;