From 8a205163b41aed389826fc1f37a41eee8d668ebf Mon Sep 17 00:00:00 2001 From: jacques Date: Sun, 16 May 2021 19:54:50 +0200 Subject: [PATCH] Fix therehold not save bug --- app/src/main/java/net/foucry/pilldroid/DBHelper.java | 2 ++ .../main/java/net/foucry/pilldroid/DrugListActivity.java | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/DBHelper.java b/app/src/main/java/net/foucry/pilldroid/DBHelper.java index 52e5131..d757f23 100644 --- a/app/src/main/java/net/foucry/pilldroid/DBHelper.java +++ b/app/src/main/java/net/foucry/pilldroid/DBHelper.java @@ -316,6 +316,8 @@ class DBHelper extends SQLiteOpenHelper { values.put(KEY_PRES, drug.getPresentation()); values.put(KEY_STOCK, drug.getStock()); values.put(KEY_TAKE, drug.getTake()); + values.put(KEY_THRESHOLD_WARN, drug.getWarnThreshold()); + values.put(KEY_THRESHOLD_ALERT, drug.getAlertThreshold()); values.put(KEY_LAST_UPDATE, drug.getDateLastUpdate()); String[] selectionArgs = { String.valueOf(drug.getId()) }; diff --git a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java index 4c3adb4..13f40e2 100644 --- a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java @@ -238,12 +238,7 @@ public class DrugListActivity extends AppCompatActivity { if (requestCode == CUSTOMIZED_REQUEST_CODE) { Toast.makeText(this, "REQUEST_CODE = " + requestCode + "RESULT_CODE = " + resultCode, Toast.LENGTH_LONG).show(); Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode); - if (resultCode == 1) { - constructDrugsList(); - } else { - Toast.makeText(this, "What are you doing here?", Toast.LENGTH_SHORT).show(); - Log.d(TAG, "What are you doing here?"); - } + constructDrugsList(); } else { IntentResult result = IntentIntegrator.parseActivityResult(resultCode, data);