diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java index 0987daf..84376c0 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java @@ -323,7 +323,7 @@ public class MedicamentListActivity extends AppCompatActivity { // Get Medoc from database final Medicament scannedMedoc = dbMedoc.getMedocByCIP13(cip13); - askToAddInDB(scannedMedoc); + askToAddInDB(scannedMedoc); } } } @@ -340,9 +340,9 @@ public class MedicamentListActivity extends AppCompatActivity { alertDialogBuilder.setCancelable(false) .setPositiveButton("OK", (dialog, id) -> { String cip13 = editText.getText().toString(); + Medicament med = dbMedoc.getMedocByCIP13(cip13); - askToAddInDB(med); - addMedToList(med); + askToAddInDB(med); }) .setNegativeButton("Cancel", (dialog, id) -> dialog.cancel()); @@ -543,4 +543,19 @@ public class MedicamentListActivity extends AppCompatActivity { } } } -} \ No newline at end of file +} + +/* +editText.addTextChangeListener( new TextWatcher() { + @Override + void afterTextChanged(Editable s){ + + } + void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + void onTextChanged(CharSequence s, int start, int before, int count) { + + } +}); + */ \ No newline at end of file