diff --git a/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java b/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java index 424de9c..ac57d9b 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java +++ b/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java @@ -17,6 +17,7 @@ import android.widget.Spinner; import com.herbron.moodl.DataManagers.DatabaseManager; import com.herbron.moodl.DataManagers.ExchangeManager.Exchange; +import com.herbron.moodl.DataManagers.PreferencesManager; import com.herbron.moodl.R; public class AddExchangeActivity extends AppCompatActivity { @@ -115,6 +116,9 @@ public class AddExchangeActivity extends AppCompatActivity { public void onClick(View v) { if(isEditTextFilled(accountLabelEditText) && isEditTextFilled(publicKeyEditText) && isEditTextFilled(secretKeyEditText)) { + PreferencesManager preferencesManager = new PreferencesManager(getBaseContext()); + preferencesManager.setMustUpdateSummary(true); + databaseManager.deleteExchangeAccountFromId(exchangeInfos.getId()); databaseManager.addExchange(accountLabelEditText.getText().toString(), exchangeSpinner.getSelectedItemPosition() , accountDescriptionEditText.getText().toString(), publicKeyEditText.getText().toString() @@ -139,6 +143,9 @@ public class AddExchangeActivity extends AppCompatActivity { public void onClick(View v) { if(isEditTextFilled(accountLabelEditText) && isEditTextFilled(publicKeyEditText) && isEditTextFilled(secretKeyEditText)) { + PreferencesManager preferencesManager = new PreferencesManager(getBaseContext()); + preferencesManager.setMustUpdateSummary(true); + databaseManager.addExchange(accountLabelEditText.getText().toString(), exchangeSpinner.getSelectedItemPosition() , accountDescriptionEditText.getText().toString(), publicKeyEditText.getText().toString() , secretKeyEditText.getText().toString()); diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java b/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java index 35e130d..e851449 100644 --- a/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java +++ b/app/src/main/java/com/herbron/moodl/DataManagers/BalanceManager.java @@ -123,6 +123,7 @@ public class BalanceManager { for(int i = 0; i < hitBtcManagers.size(); i++) { + final HitBtcManager hitBtcManager = hitBtcManagers.get(i); hitBtcManagers.get(i).updateGlobalBalance(new HitBtcManager.HitBtcCallBack() { @Override public void onSuccess() { @@ -131,6 +132,7 @@ public class BalanceManager { @Override public void onError(String error) { + databaseManager.disableExchangeAccount(hitBtcManager.getId()); dataNotifierInterface.onBalanceError(error); } });