From 9507ef8eb8765aa7ce94cc4b89805ad2ebe52d78 Mon Sep 17 00:00:00 2001 From: Majo Cecunda Date: Fri, 18 Apr 2014 01:43:09 +0200 Subject: [PATCH] #2 we have no tmp DB now --- .../formulamanager/app/CreationActivity.java | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/FormulaManager/app/src/main/java/cz/fi/android/formulamanager/app/CreationActivity.java b/FormulaManager/app/src/main/java/cz/fi/android/formulamanager/app/CreationActivity.java index b2dd3ee..a6c80b3 100644 --- a/FormulaManager/app/src/main/java/cz/fi/android/formulamanager/app/CreationActivity.java +++ b/FormulaManager/app/src/main/java/cz/fi/android/formulamanager/app/CreationActivity.java @@ -38,18 +38,10 @@ public void onClick(View view) { newFormula.setName(((EditText) findViewById(R.id.formula_name)).getText().toString()); newFormula.setRawFormula(((EditText) findViewById(R.id.formulaText)).getText().toString()); - if(getIntent().getBooleanExtra(FormulaListFragment.F_EDIT, false)) { - //TODO update formula and its params in DB. - for (Formula f : MainActivity.valuesFromDB) { - if(f.getId() == newFormula.getId()){ - MainActivity.valuesFromDB.remove(f); - break; - } - } + //TODO update formula and its params in DB. and somehow reset list in main activity } - //TODO add formula and its params to DB. - MainActivity.valuesFromDB.add(newFormula); + //TODO add formula and its params to DB. and somehow reset list in main activity //TODO display toast CreationActivity.this.finish(); @@ -81,18 +73,6 @@ public void onClick(View view) { Formula fromDB = intent.getParcelableExtra(FormulaListFragment.FORMULA); -/* long id = intent.getLongExtra(FormulaListFragment.F_ID, -1); - if(id == -1){ - return; - } - // TODO find formula in DB - for(Formula f : MainActivity.valuesFromDB) { - if(f.getId() == id) { - fromDB = f; - break; - } - }*/ - ((EditText)findViewById(R.id.formula_name)).setText(fromDB.getName()); ((EditText)findViewById(R.id.formulaText)).setText(fromDB.getRawFormula()); for(Parameter p : fromDB.getParams()) {